File manager - Edit - /var/www/html/gop/api/tests/Feature/OrganizationTest.php
Back
<?php namespace Tests\Feature; use Illuminate\Http\JsonResponse; use Tests\BaseTest; class OrganizationTest extends BaseTest { public function test_index() { $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('get', route('organization.index') ); }/* public function test_store() { $organizationName = fake()->name(); $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('post', route('organization.store'), JsonResponse::HTTP_CREATED, [ 'name' => $organizationName, 'status' => true, ] ); } public function test_storeMany() { $organizationName1 = fake()->name(); $organizationName2 = fake()->name(); $organizationName3 = fake()->name(); $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('post', route('organization.storeMany'), JsonResponse::HTTP_CREATED, [ 'organizations' => [ [ 'name' => $organizationName1, 'status' => true, ], [ 'name' => $organizationName2, 'status' => true, ], [ 'name' => $organizationName3, 'status' => true, ], ], ] ); } public function test_show() { $organizationName = fake()->name(); $response = $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('post', route('organization.store'), JsonResponse::HTTP_CREATED, [ 'name' => $organizationName, 'status' => true, ] ); $organization_id = $response['data']['id']; $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('get', route('organization.show', $organization_id) ); } public function test_update() { $organizationName = fake()->name(); $response = $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('post', route('organization.store'), JsonResponse::HTTP_CREATED, [ 'name' => $organizationName, 'status' => true, ] ); $organization_id = $response['data']['id']; $organizationName2 = fake()->name(); $this->withHeaders([ 'Authorization' => 'Bearer '.$this->getToken(), ])->simpleRequest('put', route('organization.update', $organization_id), JsonResponse::HTTP_OK, [ 'name' => $organizationName2, 'status' => true, ] ); }*/ }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings