File manager - Edit - /var/www/html/gop/api/tests/Feature/FaseTest.php
Back
<?php namespace Tests\Feature; use App\Models\Fase; use Illuminate\Http\JsonResponse; use Illuminate\Http\UploadedFile; use Tests\BaseTest; class FaseTest extends BaseTest { public function test_index() { Fase::factory(5)->create(); $this->authRequest( 'get', route('fase.index'), ); } public function test_store() { $request = Fase::factory()->make()->toArray(); $this->authRequest( 'post', route('fase.store'), JsonResponse::HTTP_CREATED, $request, ); } public function test_show() { $fase = Fase::factory()->create(); $this->authRequest( 'get', route('fase.show', $fase->id), ); } public function test_update() { $fase = Fase::factory()->create(); $request = Fase::factory()->make()->toArray(); $this->authRequest( 'put', route('fase.update', $fase->id), JsonResponse::HTTP_OK, $request, ); } public function test_destroy() { $fase = Fase::factory()->create(); $this->authRequest( 'delete', route('fase.destroy', $fase->id), JsonResponse::HTTP_NO_CONTENT, ); } public function test_storeImage_and_showImage() { $modelo = Fase::factory()->create(); $image = new UploadedFile( storage_path('test/assinatura.png'), 'assinatura.png', 'image/png', null, true ); $request = [ 'image' => $image, ]; $response = $this->authRequest( 'post', route('fase.storeImage', $modelo->id), JsonResponse::HTTP_CREATED, $request, ); $this->authRequest( 'get', route('fase.showModelImages', $modelo->id), JsonResponse::HTTP_OK, $request, ); $this->removeTestFiles($response->json('path')); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings