4 changed files with 43 additions and 43 deletions
-
4resources/views/projects/index.blade.php
-
37tests/Feature/Auth/MemberLoginTest.php
-
41tests/Feature/Auth/MemberRegistrationTest.php
-
2tests/Feature/ManageUsersTest.php
@ -0,0 +1,37 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Tests\Feature\Auth; |
||||
|
|
||||
|
use App\Entities\Users\User; |
||||
|
use Tests\TestCase; |
||||
|
|
||||
|
class MemberLoginTest extends TestCase |
||||
|
{ |
||||
|
/** @test */ |
||||
|
public function member_register_and_login_successfully() |
||||
|
{ |
||||
|
$user = factory(User::class)->create(['name' => 'Nama Member', 'username' => 'namamember', 'email' => 'email@mail.com']); |
||||
|
$user->assignRole('customer'); |
||||
|
|
||||
|
$this->visit(route('auth.login')); |
||||
|
$this->type('namamember','username'); |
||||
|
$this->type('member','password'); |
||||
|
$this->press(trans('auth.login')); |
||||
|
$this->seePageIs(route('home')); |
||||
|
$this->see('Selamat datang kembali Nama Member.'); |
||||
|
$this->click('Keluar'); |
||||
|
$this->seePageIs(route('auth.login')); |
||||
|
$this->see('Anda telah logout.'); |
||||
|
} |
||||
|
|
||||
|
/** @test */ |
||||
|
public function member_invalid_login() |
||||
|
{ |
||||
|
$this->visit(route('auth.login')); |
||||
|
$this->type('namamember','username'); |
||||
|
$this->type('password.112','password'); |
||||
|
$this->press(trans('auth.login')); |
||||
|
$this->seePageIs(route('auth.login')); |
||||
|
$this->see('Mohon maaf, anda tidak dapat login'); |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
namespace Tests\Feature\Auth; |
|
||||
|
namespace Tests\Feature; |
||||
|
|
||||
use App\Entities\Users\User; |
use App\Entities\Users\User; |
||||
use Tests\TestCase; |
use Tests\TestCase; |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue