Skip to content

Commit

Permalink
OXDEV-8688 Fix password change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TitaKoleva committed Sep 25, 2024
1 parent 616822f commit 10bf9aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Integration/Event/PasswordChangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
namespace OxidEsales\GraphQL\Base\Tests\Integration\Event;

use DateTimeImmutable;
use Lcobucci\JWT\Token\DataSet;
use Lcobucci\JWT\UnencryptedToken;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionProviderInterface;
use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase;
use OxidEsales\EshopCommunity\Tests\TestContainerFactory;
use OxidEsales\GraphQL\Base\DataType\User as UserDataType;
use OxidEsales\GraphQL\Base\Infrastructure\Model\Token as TokenModel;
use OxidEsales\GraphQL\Base\Infrastructure\Token as TokenInfrastructure;
use OxidEsales\GraphQL\Base\Service\Token as TokenService;

class PasswordChangeTest extends IntegrationTestCase
{
Expand All @@ -39,7 +42,10 @@ public function setUp(): void
public function testExpireTokenAfterUserPasswordChange(): void
{
$userModel = oxNew(User::class);
$userModel->load('e7af1c3b786fd02906ccd75698f4e6b9');
$userModel->setId('_testUser');
$userModel->setPassword('_testPassword');
$userModel->assign(['oxusername' => '_testUsername']);
$userModel->save();

$issued = new DateTimeImmutable('now');
$expires = new DateTimeImmutable('+8 hours');
Expand All @@ -49,7 +55,7 @@ public function testExpireTokenAfterUserPasswordChange(): void
[
'OXID' => '_changePwdUserToken',
'OXSHOPID' => '1',
'OXUSERID' => 'e7af1c3b786fd02906ccd75698f4e6b9',
'OXUSERID' => '_testUser',
'ISSUED_AT' => $issued->format('Y-m-d H:i:s'),
'EXPIRES_AT' => $expires->format('Y-m-d H:i:s'),
'USERAGENT' => '',
Expand Down

0 comments on commit 10bf9aa

Please sign in to comment.