File manager - Edit - /var/www/html/gop/api/tests/Feature/AuthTest.php
Back
<?php namespace Tests\Feature; use Illuminate\Http\JsonResponse; use Tests\BaseTest; class AuthTest extends BaseTest { public function test_login() { $response = $this->simpleRequest('post', route('auth.login'), JsonResponse::HTTP_OK, [ 'username' => env('AUTH_TEST_USER', 'usuario'), 'password' => env('AUTH_TEST_PASS', '123456'), ] ); $response->assertSee('access_token'); } public function test_login_without_cpf_or_password() { $this->simpleRequest('post', route('auth.login'), JsonResponse::HTTP_UNAUTHORIZED, [ 'password' => env('AUTH_TEST_PASS', '123456a'), ] ); $this->simpleRequest('post', route('auth.login'), JsonResponse::HTTP_BAD_REQUEST, [ 'username' => env('AUTH_TEST_USER', '67108857049'), ] ); } public function test_logout() { $response = $this->simpleRequest('post', route('auth.login'), JsonResponse::HTTP_OK, [ 'username' => env('AUTH_TEST_USER', '67108857049'), 'password' => env('AUTH_TEST_PASS', '123456a'), ] ); $response->assertSee('access_token'); $this->withHeaders([ 'Authorization' => 'Bearer '.$response['access_token'], ])->simpleRequest('post', route('auth.logout'), JsonResponse::HTTP_NO_CONTENT ); } public function test_first_login() { self::markTestSkipped(); $response = $this->simpleRequest('post', route('user.modifyPassword'), JsonResponse::HTTP_OK, [ 'username' => env('AUTH_TEST_USER', 'usuario'), 'new_password' => env('AUTH_TEST_PASS', '1234567'), 'new_password_confirmation' => env('AUTH_TEST_PASS', '123456a'), 'current_password' => env('AUTH_FIRST_ACCESS_PASS', '123456'), ] ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings