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