From aaa7df96a42d0a7d10eaa18e4bb5c10100f9d711 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 29 Sep 2015 18:14:48 -0700 Subject: [PATCH] Added testStaleSet() WAN cache test Change-Id: Ib8565c48af09af0df1809e877fde9d4d6c7e7038 --- tests/phpunit/includes/objectcache/WANObjectCacheTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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() */ -- 2.20.1