Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330363 )

Change subject: phpunit: Use assertEquals(, $delta) in UserTest instead of 
greater/lessThan
......................................................................

phpunit: Use assertEquals(, $delta) in UserTest instead of greater/lessThan

Follows-up 9d8358e09.

Documented at
https://phpunit.de/manual/4.8/en/appendixes.assertions.html#appendixes.assertions.assertEquals

Change-Id: Id337626c069663883d6a4bde58432637d33eb8c0
---
M tests/phpunit/includes/user/UserTest.php
1 file changed, 4 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/330363/1

diff --git a/tests/phpunit/includes/user/UserTest.php 
b/tests/phpunit/includes/user/UserTest.php
index 5d9cda7..35f5d6a 100644
--- a/tests/phpunit/includes/user/UserTest.php
+++ b/tests/phpunit/includes/user/UserTest.php
@@ -726,13 +726,10 @@
                $this->assertArrayHasKey( 'wm_infinite_blockBlockID', $cookies 
);
                $expOneDay = wfTimestamp() + ( 24 * 60 * 60 );
                // Check for expiry dates in a 10-second window, to account for 
slow testing.
-               $this->assertGreaterThan(
-                       $expOneDay - 5,
-                       $cookies['wm_infinite_blockBlockID']['expire']
-               );
-               $this->assertLessThan(
-                       $expOneDay + 5,
-                       $cookies['wm_infinite_blockBlockID']['expire']
+               $this->assertEquals(
+                       $expOneDay,
+                       $cookies['wm_infinite_blockBlockID']['expire'],
+                       5.0
                );
 
                // 3. Change the block's expiry (to 2 hours), and the cookie's 
should be changed also.

-- 
To view, visit https://gerrit.wikimedia.org/r/330363
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id337626c069663883d6a4bde58432637d33eb8c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to