Skip to content

Commit 2cfad64

Browse files
committed
Add integration test for unsuccessful login attempt
1 parent ffa1cf2 commit 2cfad64

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,25 @@ public function testLoginWithRedirectToDashboardDisabled(): void
144144
$this->assertRedirect($this->stringContains('test_redirect'));
145145
}
146146

147+
/**
148+
* @magentoConfigFixture current_store customer/startup/redirect_dashboard 0
149+
* @magentoConfigFixture current_store customer/captcha/enable 0
150+
*
151+
* @magentoDataFixture Magento/Customer/_files/customer.php
152+
*
153+
* @return void
154+
*/
155+
public function testLoginFailureWithRedirectToDashboardDisabled(): void
156+
{
157+
$this->prepareRequest('[email protected]', 'incorrect');
158+
$this->dispatch('customer/account/loginPost');
159+
$this->assertFalse($this->session->isLoggedIn());
160+
$this->assertRedirect($this->logicalAnd(
161+
$this->stringContains('customer/account/login'),
162+
$this->logicalnot($this->stringContains('referer'))
163+
));
164+
}
165+
147166
/**
148167
* @magentoConfigFixture current_store customer/startup/redirect_dashboard 0
149168
* @magentoConfigFixture current_store customer/captcha/enable 0

0 commit comments

Comments
 (0)