-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/b-7.2.x' into b-8.0.x
- Loading branch information
Showing
10 changed files
with
333 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/Codeception/Acceptance/Admin/SessionHandlingCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\EshopCommunity\Tests\Codeception\Acceptance\Admin; | ||
|
||
use Codeception\Attribute\Group; | ||
use Codeception\Util\Fixtures; | ||
use OxidEsales\EshopCommunity\Tests\Codeception\Support\AcceptanceTester; | ||
|
||
final class SessionHandlingCest | ||
{ | ||
#[Group('session')] | ||
public function adminSessionAfterPasswordChange(AcceptanceTester $I): void | ||
{ | ||
$I->wantToTest('that admin will be logged out if someone changes his password from another active session'); | ||
$userData = Fixtures::get('adminUser'); | ||
$adminLoginPage = $I->openAdmin(); | ||
$I->amGoingTo('log the existing admin in'); | ||
$adminLoginPage->login($userData['userLoginName'], $userData['userPassword']); | ||
|
||
$I->amGoingTo('mock password change for this admin from another browser session'); | ||
$I->updateInDatabase( | ||
'oxuser', | ||
['OXPASSWORD' => 'some-new-password-hash'], | ||
['OXUSERNAME' => $userData['userLoginName']] | ||
); | ||
|
||
$I->amGoingTo('send any page request after password change'); | ||
$I->reloadPage(); | ||
|
||
$I->expect('that admin is logged out'); | ||
$adminLoginPage->seeLoginForm(); | ||
} | ||
} |
Oops, something went wrong.