Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/253461

Change subject: objectcache: Add @covers for WANObjectCache unit tests
......................................................................

objectcache: Add @covers for WANObjectCache unit tests

Has only ~ 30% coverage according to PHPUnit, but mostly due to
lack of @covers annotations.

Change-Id: I871b45d8d8ee22c7cda644c450d78f577584e78c
---
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
1 file changed, 20 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/253461/1

diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php 
b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
index a1fdd91..6495790 100644
--- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
@@ -26,7 +26,7 @@
        }
 
        /**
-        * @dataProvider provider_testSetAndGet
+        * @dataProvider provideSetAndGet
         * @covers WANObjectCache::set()
         * @covers WANObjectCache::get()
         * @param mixed $value
@@ -46,7 +46,7 @@
                }
        }
 
-       public static function provider_testSetAndGet() {
+       public static function provideSetAndGet() {
                return array(
                        array( 14141, 3 ),
                        array( 3535.666, 3 ),
@@ -60,6 +60,9 @@
                );
        }
 
+       /**
+        * @covers WANObjectCache::get()
+        */
        public function testGetNotExists() {
                $key = wfRandomString();
                $curTTL = null;
@@ -69,6 +72,9 @@
                $this->assertNull( $curTTL, "Non-existing key has null current 
TTL" );
        }
 
+       /**
+        * @covers WANObjectCache::set()
+        */
        public function testSetOver() {
                $key = wfRandomString();
                for ( $i = 0; $i < 3; ++$i ) {
@@ -79,6 +85,9 @@
                }
        }
 
+       /**
+        * @covers WANObjectCache::set()
+        */
        public function testStaleSet() {
                $key = wfRandomString();
                $value = wfRandomString();
@@ -89,6 +98,7 @@
 
        /**
         * @covers WANObjectCache::getWithSetCallback()
+        * @covers WANObjectCache::doGetWithSetCallback()
         */
        public function testGetWithSetCallback() {
                $cache = $this->cache;
@@ -163,6 +173,7 @@
 
        /**
         * @covers WANObjectCache::getWithSetCallback()
+        * @covers WANObjectCache::doGetWithSetCallback()
         */
        public function testLockTSE() {
                $cache = $this->cache;
@@ -188,6 +199,7 @@
 
        /**
         * @covers WANObjectCache::getWithSetCallback()
+        * @covers WANObjectCache::doGetWithSetCallback()
         */
        public function testLockTSESlow() {
                $cache = $this->cache;
@@ -343,6 +355,9 @@
                $this->assertEquals( $t5, $t6, 'Check key time did not change' 
);
        }
 
+       /**
+        * @covers WANObjectCache::set()
+        */
        public function testSetWithLag() {
                $value = 1;
 
@@ -362,6 +377,9 @@
                $this->assertEquals( false, $this->cache->get( $key ), "Lagged 
value not written." );
        }
 
+       /**
+        * @covers WANObjectCache::set()
+        */
        public function testWritePending() {
                $value = 1;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/253461
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I871b45d8d8ee22c7cda644c450d78f577584e78c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to