Merge "Declare and document $wgStatsdServer and $wgStatsdMetricPrefix"
[lhc/web/wiklou.git] / tests / phpunit / includes / objectcache / WANObjectCacheTest.php
index 3e284c8..10f64be 100644 (file)
@@ -66,9 +66,9 @@ class WANObjectCacheTest extends MediaWikiTestCase {
 
        public function testSetOver() {
                $key = wfRandomString();
-               for ( $i=0; $i<3; ++$i ) {
+               for ( $i = 0; $i < 3; ++$i ) {
                        $value = wfRandomString();
-                       $this->cache->set($key, $value, 3);
+                       $this->cache->set( $key, $value, 3 );
 
                        $this->assertEquals( $this->cache->get( $key ), $value );
                }
@@ -229,8 +229,10 @@ class WANObjectCacheTest extends MediaWikiTestCase {
        public function testTouchKeys() {
                $key = wfRandomString();
 
+               $priorTime = microtime( true );
+               usleep( 1 );
                $t0 = $this->cache->getCheckKeyTime( $key );
-               $this->assertFalse( $t0, 'Check key time is false' );
+               $this->assertGreaterThanOrEqual( $priorTime, $t0, 'Check key auto-created' );
 
                $priorTime = microtime( true );
                usleep( 1 );
@@ -249,4 +251,4 @@ class WANObjectCacheTest extends MediaWikiTestCase {
                $t4 = $this->cache->getCheckKeyTime( $key );
                $this->assertEquals( $t3, $t4, 'Check key time did not change' );
        }
-}
\ No newline at end of file
+}