Unverified Commit cf420162 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #94 from viralsolani/analysis-8LDQ4w

Apply fixes from StyleCI
parents 01dbc4f5 8817c374
...@@ -20,11 +20,11 @@ $factory->define(User::class, function (Generator $faker) { ...@@ -20,11 +20,11 @@ $factory->define(User::class, function (Generator $faker) {
return [ return [
'first_name' => $faker->name, 'first_name' => $faker->name,
'last_name' => $faker->name, 'last_name' => $faker->name,
'email' => $faker->safeEmail, 'email' => $faker->safeEmail,
'password' => $password ?: $password = bcrypt('secret'), 'password' => $password ?: $password = bcrypt('secret'),
'confirmation_code' => md5(uniqid(mt_rand(), true)), 'confirmation_code' => md5(uniqid(mt_rand(), true)),
'remember_token' => str_random(10) 'remember_token' => str_random(10),
]; ];
}); });
...@@ -52,7 +52,6 @@ $factory->state(User::class, 'unconfirmed', function () { ...@@ -52,7 +52,6 @@ $factory->state(User::class, 'unconfirmed', function () {
]; ];
}); });
/* /*
* Roles * Roles
*/ */
......
...@@ -43,7 +43,7 @@ abstract class BrowserKitTestCase extends BaseTestCase ...@@ -43,7 +43,7 @@ abstract class BrowserKitTestCase extends BaseTestCase
*/ */
protected $userRole; protected $userRole;
/** /**
* Set up tests. * Set up tests.
*/ */
public function setUp() public function setUp()
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
namespace Tests\Feature; namespace Tests\Feature;
use App\Events\Frontend\Auth\UserLoggedIn;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Tests\BrowserKitTestCase;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
use App\Events\Frontend\Auth\UserLoggedIn; use Tests\BrowserKitTestCase;
class AuthTest extends BrowserKitTestCase class AuthTest extends BrowserKitTestCase
{ {
...@@ -44,22 +44,22 @@ class AuthTest extends BrowserKitTestCase ...@@ -44,22 +44,22 @@ class AuthTest extends BrowserKitTestCase
public function users_can_login() public function users_can_login()
{ {
// Make sure our events are fired // Make sure our events are fired
Event::fake(); Event::fake();
Auth::logout(); Auth::logout();
//User Test //User Test
$this->visit('/login') $this->visit('/login')
->type($this->user->email, 'email') ->type($this->user->email, 'email')
->type('1234', 'password') ->type('1234', 'password')
->press('Login') ->press('Login')
->see($this->user->name) ->see($this->user->name)
->seePageIs('/dashboard'); ->seePageIs('/dashboard');
Auth::logout(); Auth::logout();
//Admin Test //Admin Test
$this->visit('/login') $this->visit('/login')
->type($this->admin->email, 'email') ->type($this->admin->email, 'email')
->type('1234', 'password') ->type('1234', 'password')
->press('Login') ->press('Login')
...@@ -67,6 +67,6 @@ class AuthTest extends BrowserKitTestCase ...@@ -67,6 +67,6 @@ class AuthTest extends BrowserKitTestCase
->see($this->admin->first_name) ->see($this->admin->first_name)
->see('Access Management'); ->see('Access Management');
Event::assertDispatched(UserLoggedIn::class); Event::assertDispatched(UserLoggedIn::class);
} }
} }
...@@ -4,8 +4,8 @@ namespace Tests; ...@@ -4,8 +4,8 @@ namespace Tests;
use App\Models\Access\Role\Role; use App\Models\Access\Role\Role;
use App\Models\Access\User\User; use App\Models\Access\User\User;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Facades\Artisan;
abstract class TestCase extends BaseTestCase abstract class TestCase extends BaseTestCase
{ {
...@@ -41,7 +41,7 @@ abstract class TestCase extends BaseTestCase ...@@ -41,7 +41,7 @@ abstract class TestCase extends BaseTestCase
*/ */
protected $userRole; protected $userRole;
/** /**
* Set up tests. * Set up tests.
*/ */
public function setUp() public function setUp()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment