File manager - Edit - /var/www/html/spdc/api/tests/Feature/OccurrencyInspectionTest.php
Back
<?php namespace Tests\Feature; use Tests\BaseTest; use App\Models\Form; use App\Models\Field; use App\Models\Category; use App\Models\Occurrency; use App\Models\CategoryOption; use App\Models\OccurrencyType; use Illuminate\Http\JsonResponse; use Illuminate\Http\UploadedFile; use AluisioPires\LaravelBaseTest\BaseTestTransactions; class OccurrencyInspectionTest extends BaseTest { public function test_save() { // deleting existing occurrencys Occurrency::query()->delete(); $occurrency = Occurrency::factory()->withForms()->create(); $request = []; $index = 0; foreach($occurrency->forms as $form) { $request['forms'][$index]['id'] = $form->id; foreach($form->fields as $field) { $request['forms'][$index]['fields'][] = [ 'id' => $field->id, 'value' => fake()->text ]; } } // creating a text occurrency $response = $this->authRequest( 'post', route('occurrency.inspection.save', $occurrency), JsonResponse::HTTP_OK, $request ); // dump($response->json()); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.12 |
proxy
|
phpinfo
|
Settings