Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/PasswordResetTest.php
Show All 16 Lines | class PasswordResetTest extends DuskTestCase | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function setUp(): void | public function setUp(): void | ||||
{ | { | ||||
parent::setUp(); | parent::setUp(); | ||||
$user = User::firstOrCreate(['email' => 'passwordresettestdusk@' . \config('app.domain')]); | $this->deleteTestUser('passwordresettestdusk@' . \config('app.domain')); | ||||
$user->setSetting('external_email', 'external@domain.tld'); | |||||
} | } | ||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function tearDown(): void | public function tearDown(): void | ||||
{ | { | ||||
User::where('email', 'passwordresettestdusk@' . \config('app.domain'))->delete(); | $this->deleteTestUser('passwordresettestdusk@' . \config('app.domain')); | ||||
parent::tearDown(); | |||||
} | } | ||||
/** | /** | ||||
* Test the link from logon to password-reset page | * Test the link from logon to password-reset page | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function testPasswordResetLinkOnLogon() | public function testPasswordResetLinkOnLogon() | ||||
Show All 11 Lines | class PasswordResetTest extends DuskTestCase | ||||
/** | /** | ||||
* Test 1st step of password-reset | * Test 1st step of password-reset | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function testPasswordResetStep1() | public function testPasswordResetStep1() | ||||
{ | { | ||||
$user = $this->getTestUser('passwordresettestdusk@' . \config('app.domain')); | |||||
$user->setSetting('external_email', 'external@domain.tld'); | |||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new PasswordReset()); | $browser->visit(new PasswordReset()); | ||||
$browser->assertVisible('@step1'); | $browser->assertVisible('@step1'); | ||||
// Here we expect email input and submit button | // Here we expect email input and submit button | ||||
$browser->with('@step1', function ($step) { | $browser->with('@step1', function ($step) { | ||||
$step->assertVisible('#reset_email'); | $step->assertVisible('#reset_email'); | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |