Merge "tests: Replace PHPUnit's loose assertEquals(null) with assertNull()"
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / objectcache / WANObjectCacheTest.php
index 72ac567..0c084e0 100644 (file)
@@ -407,8 +407,8 @@ class WANObjectCacheTest extends PHPUnit\Framework\TestCase {
                $v = $cache->getWithSetCallback(
                        $key, 30, $checkFunc, [ 'staleTTL' => 50 ] + $extOpts );
                $this->assertEquals( 'xxx1', $v, "Value returned" );
-               $this->assertEquals( false, $oldValReceived, "Callback got no stale value" );
-               $this->assertEquals( null, $oldAsOfReceived, "Callback got no stale value" );
+               $this->assertFalse( $oldValReceived, "Callback got no stale value" );
+               $this->assertNull( $oldAsOfReceived, "Callback got no stale value" );
 
                $mockWallClock += 40;
                $v = $cache->getWithSetCallback(
@@ -423,8 +423,8 @@ class WANObjectCacheTest extends PHPUnit\Framework\TestCase {
                        $key, 30, $checkFunc, [ 'staleTTL' => 50 ] + $extOpts );
                $this->assertEquals( 'xxx3', $v, "Value still returned after expired" );
                $this->assertEquals( 3, $wasSet, "Value recalculated while expired" );
-               $this->assertEquals( false, $oldValReceived, "Callback got no stale value" );
-               $this->assertEquals( null, $oldAsOfReceived, "Callback got no stale value" );
+               $this->assertFalse( $oldValReceived, "Callback got no stale value" );
+               $this->assertNull( $oldAsOfReceived, "Callback got no stale value" );
 
                $mockWallClock = ( $priorTime - $cache::HOLDOFF_TTL - 1 );
                $wasSet = 0;
@@ -440,8 +440,8 @@ class WANObjectCacheTest extends PHPUnit\Framework\TestCase {
                );
                $this->assertEquals( 'xxx1', $v, "Value returned" );
                $this->assertEquals( 1, $wasSet, "Value computed" );
-               $this->assertEquals( false, $oldValReceived, "Callback got no stale value" );
-               $this->assertEquals( null, $oldAsOfReceived, "Callback got no stale value" );
+               $this->assertFalse( $oldValReceived, "Callback got no stale value" );
+               $this->assertNull( $oldAsOfReceived, "Callback got no stale value" );
 
                $mockWallClock += $cache::TTL_HOUR; // some time passes
                $v = $cache->getWithSetCallback(
@@ -1499,7 +1499,7 @@ class WANObjectCacheTest extends PHPUnit\Framework\TestCase {
                $this->assertEquals( $valueV2, $v, "Value returned" );
                $this->assertEquals( 1, $wasSet, "Value regenerated" );
                $this->assertEquals( false, $priorValue, "Old value not given due to old format" );
-               $this->assertEquals( null, $priorAsOf, "Old value not given due to old format" );
+               $this->assertNull( $priorAsOf, "Old value not given due to old format" );
 
                $wasSet = 0;
                $v = $cache->getWithSetCallback( $key, 30, $funcV2, $verOpts + $extOpts );