You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
<?php
|
|
|
|
use App\Entities\Users\User;
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
|
|
class MemberChangePasswordTest extends TestCase
|
|
{
|
|
use DatabaseTransactions;
|
|
|
|
/** @test */
|
|
public function member_can_change_password()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$user->assignRole('customer');
|
|
$this->actingAs($user);
|
|
|
|
$this->visit('home');
|
|
$this->seePageIs('home');
|
|
$this->click(trans('auth.change_password'));
|
|
|
|
$this->type('member1','old_password');
|
|
$this->type('rahasia','password');
|
|
$this->type('rahasia','password_confirmation');
|
|
$this->press('Ganti Password');
|
|
$this->see('Password lama tidak cocok');
|
|
|
|
$this->type('member','old_password');
|
|
$this->type('rahasia','password');
|
|
$this->type('rahasia','password_confirmation');
|
|
$this->press('Ganti Password');
|
|
$this->see('Password berhasil diubah');
|
|
|
|
// Logout and login using new Password
|
|
$this->click('Keluar');
|
|
$this->seePageIs('auth/login');
|
|
$this->type($user->username,'username');
|
|
$this->type('rahasia','password');
|
|
$this->press('Login');
|
|
$this->seePageIs('home');
|
|
}
|
|
}
|