Skip to content

Commit

Permalink
updated for php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthaksavvy committed Sep 9, 2021
1 parent 8d67f19 commit 484a39c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/composer.lock
/.DS_Store
/.idea
/.php_cs.cache
/.php_cs.cache
.phpunit.result.cache
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 2 additions & 0 deletions src/Http/routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;

Route::post('register', 'AuthController@register')->name('user.register');
Route::post('login', 'LoginController@login')->name('user.login');
Route::post('logout', 'LoginController@logout')->name('logout');
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/RegisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Mail;

class ExampleTest extends TestCase
class RegisterTest extends TestCase
{
use DatabaseMigrations;

Expand Down Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
Expand Down

0 comments on commit 484a39c

Please sign in to comment.