Skip to content

Commit

Permalink
MNT Remove unit test for removed method
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 15, 2025
1 parent 9b61628 commit d480d05
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions tests/php/Security/RememberLoginHashTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,47 +97,4 @@ public function testGetSetLogoutAcrossDevices()
RememberLoginHash::setLogoutAcrossDevices(false);
$this->assertFalse(RememberLoginHash::getLogoutAcrossDevices());
}

/**
* @param bool $replaceToken
*/
#[DataProvider('provideRenew')]
public function testRenew($replaceToken)
{
// If session-manager module is installed it expects an active request during renewal
if (class_exists(LoginSession::class)) {
$this->markTestSkipped();
}

$member = $this->objFromFixture(Member::class, 'main');

Deprecation::withSuppressedNotice(
fn() => RememberLoginHash::config()->set('replace_token_during_session_renewal', $replaceToken)
);

$hash = RememberLoginHash::generate($member);
$oldToken = $hash->getToken();
$oldHash = $hash->Hash;

// Fetch the token from the DB - otherwise we still have the token from when this was originally created
$storedHash = RememberLoginHash::get()->find('ID', $hash->ID);

Deprecation::withSuppressedNotice(fn() => $storedHash->renew());

if ($replaceToken) {
$this->assertNotEquals($oldToken, $storedHash->getToken());
$this->assertNotEquals($oldHash, $storedHash->Hash);
} else {
$this->assertEmpty($storedHash->getToken());
$this->assertEquals($oldHash, $storedHash->Hash);
}
}

public static function provideRenew(): array
{
return [
[true],
[false],
];
}
}

0 comments on commit d480d05

Please sign in to comment.