From 304ad79cbbd4d8990dd178721d70adb99a024c84 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 3 Jan 2017 19:29:35 -0800 Subject: [PATCH] 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 --- tests/phpunit/includes/user/UserTest.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php index 5d9cda7c44..8b9d11baf1 100644 --- a/tests/phpunit/includes/user/UserTest.php +++ b/tests/phpunit/includes/user/UserTest.php @@ -726,13 +726,11 @@ class UserTest extends MediaWikiTestCase { $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'], + 'Expiry date', + 5.0 ); // 3. Change the block's expiry (to 2 hours), and the cookie's should be changed also. -- 2.20.1