summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/objectcache/BagOStuffTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/objectcache/BagOStuffTest.php')
-rw-r--r--tests/phpunit/includes/objectcache/BagOStuffTest.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/phpunit/includes/objectcache/BagOStuffTest.php b/tests/phpunit/includes/objectcache/BagOStuffTest.php
index 88b07f0a..aa783943 100644
--- a/tests/phpunit/includes/objectcache/BagOStuffTest.php
+++ b/tests/phpunit/includes/objectcache/BagOStuffTest.php
@@ -15,7 +15,6 @@ class BagOStuffTest extends MediaWikiTestCase {
$name = $this->getCliArg( 'use-bagostuff=' );
$this->cache = ObjectCache::newFromId( $name );
-
} else {
// no type defined - use simple hash
$this->cache = new HashBagOStuff;
@@ -119,6 +118,18 @@ class BagOStuffTest extends MediaWikiTestCase {
$this->assertEquals( $this->cache->get( $key ), $value );
}
+ /**
+ * @covers BagOStuff::incr
+ */
+ public function testIncr() {
+ $key = wfMemcKey( 'test' );
+ $this->cache->add( $key, 0 );
+ $this->cache->incr( $key );
+ $expectedValue = 1;
+ $actualValue = $this->cache->get( $key );
+ $this->assertEquals( $expectedValue, $actualValue, 'Value should be 1 after incrementing' );
+ }
+
public function testGetMulti() {
$value1 = array( 'this' => 'is', 'a' => 'test' );
$value2 = array( 'this' => 'is', 'another' => 'test' );