Added testStaleSet() WAN cache test
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 30 Sep 2015 01:14:48 +0000 (18:14 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 30 Sep 2015 01:14:48 +0000 (18:14 -0700)
Change-Id: Ib8565c48af09af0df1809e877fde9d4d6c7e7038

tests/phpunit/includes/objectcache/WANObjectCacheTest.php

index 9b4eca7..742b737 100644 (file)
@@ -74,6 +74,14 @@ class WANObjectCacheTest extends MediaWikiTestCase {
                }
        }
 
+       public function testStaleSet() {
+               $key = wfRandomString();
+               $value = wfRandomString();
+               $this->cache->set( $key, $value, 3, array( 'since' => microtime( true ) - 30 ) );
+
+               $this->assertFalse( $this->cache->get( $key ), "Stale set() value ignored" );
+       }
+
        /**
         * @covers WANObjectCache::getWithSetCallback()
         */