From: Timo Tijhof Date: Wed, 4 Jan 2017 03:29:35 +0000 (-0800) Subject: phpunit: Use assertEquals(, $delta) in UserTest instead of greater/lessThan X-Git-Tag: 1.31.0-rc.0~4376^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=304ad79cbbd4d8990dd178721d70adb99a024c84;p=lhc%2Fweb%2Fwiklou.git 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 --- 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.