mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed test which heavily depended on timing of the assertation functions
This caused a lot of false positive test failures.
This commit is contained in:
parent
3470a5fa5d
commit
dd38749081
1 changed files with 3 additions and 1 deletions
|
@ -88,10 +88,12 @@ class UserTest extends TestCase
|
||||||
public function testSetBackupCodes(): void
|
public function testSetBackupCodes(): void
|
||||||
{
|
{
|
||||||
$user = new User();
|
$user = new User();
|
||||||
|
$this->assertNull($user->getBackupCodesGenerationDate());
|
||||||
|
|
||||||
$codes = ['test', 'invalid', 'test'];
|
$codes = ['test', 'invalid', 'test'];
|
||||||
$user->setBackupCodes($codes);
|
$user->setBackupCodes($codes);
|
||||||
// Backup Codes generation date must be changed!
|
// Backup Codes generation date must be changed!
|
||||||
$this->assertEqualsWithDelta(new DateTime(), $user->getBackupCodesGenerationDate(), 0.1);
|
$this->assertInstanceOf(\DateTime::class, $user->getBackupCodesGenerationDate());
|
||||||
$this->assertSame($codes, $user->getBackupCodes());
|
$this->assertSame($codes, $user->getBackupCodes());
|
||||||
|
|
||||||
//Test what happens if we delete the backup keys
|
//Test what happens if we delete the backup keys
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue