From: Matthew Flaschen Date: Tue, 22 Oct 2013 05:55:25 +0000 (-0400) Subject: Test BagOStuff->incr method X-Git-Tag: 1.31.0-rc.0~18435^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=7cff82a1184e51c64c4e7cd89a52ef95cef2d628;p=lhc%2Fweb%2Fwiklou.git Test BagOStuff->incr method Change-Id: I3b72f19df82ee302dee47dcf22b69ed9bb6ff8e0 --- diff --git a/tests/phpunit/includes/objectcache/BagOStuffTest.php b/tests/phpunit/includes/objectcache/BagOStuffTest.php index be603e5050..f6667de1f2 100644 --- a/tests/phpunit/includes/objectcache/BagOStuffTest.php +++ b/tests/phpunit/includes/objectcache/BagOStuffTest.php @@ -118,6 +118,18 @@ class BagOStuffTest extends MediaWikiTestCase { $this->assertEquals( $this->cache->get( $key ), $value ); } + /** + * @covers HashBagOStuff::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' );