From: Aaron Schulz Date: Wed, 30 Sep 2015 01:14:48 +0000 (-0700) Subject: Added testStaleSet() WAN cache test X-Git-Tag: 1.31.0-rc.0~9647^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=aaa7df96a42d0a7d10eaa18e4bb5c10100f9d711;p=lhc%2Fweb%2Fwiklou.git Added testStaleSet() WAN cache test Change-Id: Ib8565c48af09af0df1809e877fde9d4d6c7e7038 --- diff --git a/tests/phpunit/includes/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/objectcache/WANObjectCacheTest.php index 9b4eca7e50..742b737733 100644 --- a/tests/phpunit/includes/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/objectcache/WANObjectCacheTest.php @@ -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() */