File manager - Edit - /var/www/html/gop/api/tests/Feature/MaterialTest.php
Back
<?php namespace Tests\Feature; use App\Models\Material; use Illuminate\Http\JsonResponse; use Tests\BaseTest; class MaterialTest extends BaseTest { public function test_index() { Material::factory(10)->create(); $this->authRequest( 'get', route('material.index'), ); } public function test_store() { $materialArray = Material::factory()->make()->toArray(); $this->authRequest( 'post', route('material.store'), JsonResponse::HTTP_CREATED, $materialArray, ); } public function test_show() { $material = Material::factory()->create(); $this->authRequest( 'get', route('material.show', $material->id), ); } public function test_update() { $material = Material::factory()->create(); $materialArray = Material::factory()->make()->toArray(); $this->authRequest( 'put', route('material.update', $material->id), JsonResponse::HTTP_OK, $materialArray, ); } public function test_destroy() { $material = Material::factory()->create(); $this->authRequest( 'delete', route('material.destroy', $material->id), JsonResponse::HTTP_NO_CONTENT, ); } public function test_PrivateFields() { $model = Material::factory()->create(); $request = [ 'fields' => [ 'id', ], ]; $this->authRequest( 'post', route('material.setPrivateFields', $model->id), JsonResponse::HTTP_OK, $request, ); $this->authRequest( 'get', route('material.showPrivateFields', $model->id), ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings