Skip to content

Commit f4fe61b

Browse files
authored
Merge pull request craftcms#4996 from gtettelaar/fix/tests-1
Fix users tests
2 parents 4a00146 + b991437 commit f4fe61b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

tests/unit/services/UsersTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,10 @@ public function testSetVerificationCodeOnUser()
200200
$this->assertSame(32, strlen($verificationCode));
201201
$this->assertNotNull($user['verificationCode']);
202202

203-
// Check the date with a delta of 1.5 seconds.
204-
$this->assertEqualsWithDelta(
203+
$this->tester->assertEqualDates(
204+
$this,
205205
$dateTime->format('Y-m-d H:i:s'),
206-
$user['verificationCodeIssuedDate'],
207-
1.5
206+
$user['verificationCodeIssuedDate']
208207
);
209208
}
210209

tests/unit/web/UserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ public function testGetHasElevatedSessionMath()
155155
$this->user->setIdentity($this->userElement);
156156

157157
$this->_sessionGetStub(time() + 50);
158-
$this->assertSame(50, $this->user->getElevatedSessionTimeout());
158+
$this->assertEqualsWithDelta(50, $this->user->getElevatedSessionTimeout(), 2.0);
159159

160160
// If the session->get() return value is smaller than time 0 is returned
161161
$this->_sessionGetStub(time() - 50);
162-
$this->assertSame(0, $this->user->getElevatedSessionTimeout());
162+
$this->assertEqualsWithDelta(0, $this->user->getElevatedSessionTimeout(), 2.0);
163163
}
164164

165165
/**

0 commit comments

Comments
 (0)