diff --git a/.gitignore b/.gitignore index 0de9b30..249bfb1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /composer.lock /.DS_Store /.idea -/.php_cs.cache \ No newline at end of file +/.php_cs.cache +.phpunit.result.cache \ No newline at end of file diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index c27982f..0000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":4197:{a:2:{s:7:"defects";a:22:{s:75:"Bitfumes\ApiAuth\Tests\Feature\AvatarTest::api_can_update_user_avatar_field";i:4;s:100:"Bitfumes\ApiAuth\Tests\Feature\AvatarTest::api_can_delete_old_avatar_from_disk_and_create_new_avatar";i:4;s:72:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::user_can_resend_verify_email";i:4;s:68:"Bitfumes\ApiAuth\Tests\Feature\AuthTest::api_can_update_user_details";i:4;s:69:"Bitfumes\ApiAuth\Tests\Feature\LoginTest::it_can_provide_user_details";i:4;s:72:"Bitfumes\ApiAuth\Tests\Feature\LoginTest::user_can_login_and_then_logout";i:4;s:90:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::a_user_can_register_and_get_email_confirmation";i:4;s:105:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::a_user_get_404_if_user_not_found_via_id_while_verifying_email";i:4;s:69:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::user_can_Verify_its_email";i:4;s:96:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_email_password_and_name_is_required";i:4;s:85:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_email_must_be_real_email";i:4;s:92:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_password_must_be_min_of_8_chars";i:4;s:89:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_name_must_be_max_of_25_chars";i:4;s:84:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::a_user_can_login_with_email_and_password";i:4;s:77:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_login_email_password_required";i:4;s:78:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_login_email_must_be_real_email";i:4;s:85:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_login_password_must_be_min_of_8_chars";i:4;s:89:"Bitfumes\ApiAuth\Tests\Feature\ResetPasswordTest::a_password_reset_link_email_can_be_sent";i:4;s:80:"Bitfumes\ApiAuth\Tests\Feature\ResetPasswordTest::a_user_can_change_its_password";i:4;s:61:"Bitfumes\ApiAuth\Tests\Feature\socialProfileTest::testExample";i:4;s:65:"Bitfumes\ApiAuth\Tests\Unit\UserTest::it_has_many_social_profiles";i:4;s:65:"Bitfumes\ApiAuth\Tests\Unit\socialProfileTest::it_belongs_to_user";i:4;}s:5:"times";a:22:{s:75:"Bitfumes\ApiAuth\Tests\Feature\AvatarTest::api_can_update_user_avatar_field";d:0.364;s:100:"Bitfumes\ApiAuth\Tests\Feature\AvatarTest::api_can_delete_old_avatar_from_disk_and_create_new_avatar";d:0.263;s:68:"Bitfumes\ApiAuth\Tests\Feature\AuthTest::api_can_update_user_details";d:1.092;s:69:"Bitfumes\ApiAuth\Tests\Feature\LoginTest::it_can_provide_user_details";d:0.097;s:72:"Bitfumes\ApiAuth\Tests\Feature\LoginTest::user_can_login_and_then_logout";d:0.293;s:90:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::a_user_can_register_and_get_email_confirmation";d:0.241;s:105:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::a_user_get_404_if_user_not_found_via_id_while_verifying_email";d:0.283;s:72:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::user_can_resend_verify_email";d:0.197;s:69:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::user_can_Verify_its_email";d:0.293;s:96:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_email_password_and_name_is_required";d:0.301;s:85:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_email_must_be_real_email";d:0.069;s:92:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_password_must_be_min_of_8_chars";d:0.059;s:89:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_registration_name_must_be_max_of_25_chars";d:0.27;s:84:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::a_user_can_login_with_email_and_password";d:0.401;s:77:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_login_email_password_required";d:0.222;s:78:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_login_email_must_be_real_email";d:0.166;s:85:"Bitfumes\ApiAuth\Tests\Feature\ExampleTest::for_login_password_must_be_min_of_8_chars";d:0.195;s:89:"Bitfumes\ApiAuth\Tests\Feature\ResetPasswordTest::a_password_reset_link_email_can_be_sent";d:0.088;s:80:"Bitfumes\ApiAuth\Tests\Feature\ResetPasswordTest::a_user_can_change_its_password";d:0.129;s:61:"Bitfumes\ApiAuth\Tests\Feature\socialProfileTest::testExample";d:0.162;s:65:"Bitfumes\ApiAuth\Tests\Unit\UserTest::it_has_many_social_profiles";d:0.207;s:65:"Bitfumes\ApiAuth\Tests\Unit\socialProfileTest::it_belongs_to_user";d:0.265;}}} \ No newline at end of file diff --git a/composer.json b/composer.json index 6ddcbad..ef3aa36 100644 --- a/composer.json +++ b/composer.json @@ -20,17 +20,18 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "intervention/image": "^2.5", - "laravel/socialite": "^5.0", - "tymon/jwt-auth": "1.0.1", - "laravel/ui": "^3.0" + "intervention/image": "^2.6", + "laravel/sanctum": "^2.11", + "laravel/socialite": "^5.2", + "laravel/ui": "^3.3", + "tymon/jwt-auth": "1.0.2" }, "require-dev": { - "phpunit/phpunit": "^8.5|^9.3", + "phpunit/phpunit": "^9", "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^5.0|^6", - "orchestra/database": "^5.0|^6", - "illuminate/support": "7.0|8.0", + "orchestra/testbench": "^6", + "orchestra/database": "^6", + "illuminate/support": "^8.0", "fzaninotto/faker": "^1.9", "laravel/legacy-factories": "^1.0@dev" }, diff --git a/src/Http/routes.php b/src/Http/routes.php index 9c18efe..5d7acd2 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -1,5 +1,7 @@ name('user.register'); Route::post('login', 'LoginController@login')->name('user.login'); Route::post('logout', 'LoginController@logout')->name('logout'); diff --git a/tests/Feature/RegisterTest.php b/tests/Feature/RegisterTest.php index 806f555..342510b 100644 --- a/tests/Feature/RegisterTest.php +++ b/tests/Feature/RegisterTest.php @@ -9,7 +9,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Support\Facades\Mail; -class ExampleTest extends TestCase +class RegisterTest extends TestCase { use DatabaseMigrations; @@ -83,7 +83,7 @@ public function for_registration_name_must_be_max_of_25_chars() { $this->withExceptionHandling(); $res = $this->post(route('user.register'), ['name'=>'ankur sarthak shrivastava savvy']); - $this->assertEquals(session('errors')->get('name')[0], 'The name may not be greater than 25 characters.'); + $this->assertEquals(session('errors')->get('name')[0], 'The name must not be greater than 25 characters.'); } /** @test */ diff --git a/tests/TestCase.php b/tests/TestCase.php index 04c7163..dbe2bfb 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -38,6 +38,7 @@ protected function getEnvironmentSetUp($app) $app['config']->set('jwt.secret', 'abcdef'); $app['config']->set('auth.guards.api.driver', 'jwt'); + $app['config']->set('auth.guards.api.provider', 'users'); $app['config']->set('auth.defaults.guard', 'api'); $app['config']->set('auth.providers.users.model', User::class); @@ -52,7 +53,7 @@ protected function getEnvironmentSetUp($app) protected function getPackageProviders($app) { - return [ApiAuthServiceProvider::class]; + return [ApiAuthServiceProvider::class,LaravelServiceProvider::class]; } public function createUser($args = [], $num=null)