Krinkle has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345949 )
Change subject: objectcache: Complete code coverage for HashBagOStuff ...................................................................... objectcache: Complete code coverage for HashBagOStuff Change-Id: I06cb9778df8239706bf82c0c39cccb419eade4b2 --- M tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php 1 file changed, 34 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/345949/1 diff --git a/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php index c4db0cf..f44baeb 100644 --- a/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php @@ -6,6 +6,40 @@ class HashBagOStuffTest extends PHPUnit_Framework_TestCase { /** + * @covers HashBagOStuff::__construct + */ + public function testConstruct() { + $this->assertInstanceOf( + HashBagOStuff::class, + new HashBagOStuff() + ); + } + + /** + * @covers HashBagOStuff::__construct + * @expectedException InvalidArgumentException + */ + public function testConstructBadZero() { + $cache = new HashBagOStuff( [ 'maxKeys' => 0 ] ); + } + + /** + * @covers HashBagOStuff::__construct + * @expectedException InvalidArgumentException + */ + public function testConstructBadNeg() { + $cache = new HashBagOStuff( [ 'maxKeys' => -1 ] ); + } + + /** + * @covers HashBagOStuff::__construct + * @expectedException InvalidArgumentException + */ + public function testConstructBadType() { + $cache = new HashBagOStuff( [ 'maxKeys' => 'x' ] ); + } + + /** * @covers HashBagOStuff::delete */ public function testDelete() { @@ -56,7 +90,6 @@ /** * Ensure maxKeys eviction prefers keeping new keys. * - * @covers HashBagOStuff::__construct * @covers HashBagOStuff::set */ public function testEvictionAdd() { @@ -76,7 +109,6 @@ * Ensure maxKeys eviction prefers recently set keys * even if the keys pre-exist. * - * @covers HashBagOStuff::__construct * @covers HashBagOStuff::set */ public function testEvictionSet() { @@ -102,7 +134,6 @@ /** * Ensure maxKeys eviction prefers recently retrieved keys (LRU). * - * @covers HashBagOStuff::__construct * @covers HashBagOStuff::doGet * @covers HashBagOStuff::hasKey */ -- To view, visit https://gerrit.wikimedia.org/r/345949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06cb9778df8239706bf82c0c39cccb419eade4b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits