Merge "jquery.localize: Fix incorrect use of void tag for <html:msg>"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 21 Oct 2013 17:43:37 +0000 (17:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 21 Oct 2013 17:43:37 +0000 (17:43 +0000)
18 files changed:
includes/AutoLoader.php
includes/DefaultSettings.php
includes/filebackend/SwiftFileBackend.php
includes/rcfeed/RedisPubSubFeedEngine.php [new file with mode: 0644]
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php
tests/phpunit/includes/XmlTest.php
tests/phpunit/includes/ZipDirectoryReaderTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/filerepo/FileRepoTest.php
tests/phpunit/includes/filerepo/StoreBatchTest.php
tests/phpunit/includes/installer/OracleInstallerTest.php
tests/phpunit/includes/site/MediaWikiSiteTest.php
tests/phpunit/includes/site/SiteListTest.php
tests/phpunit/includes/site/SiteSQLStoreTest.php
tests/phpunit/includes/site/SiteTest.php
tests/phpunit/includes/upload/UploadBaseTest.php

index 2e82441..0706fe3 100644 (file)
@@ -851,6 +851,7 @@ $wgAutoloadLocalClasses = array(
 
        # includes/rcfeed
        'RCFeedEngine' => 'includes/rcfeed/RCFeedEngine.php',
+       'RedisPubSubFeedEngine' => 'includes/rcfeed/RedisPubSubFeedEngine.php',
        'UDPRCFeedEngine' => 'includes/rcfeed/UDPRCFeedEngine.php',
        'RCFeedFormatter' => 'includes/rcfeed/RCFeedFormatter.php',
        'IRCColourfulRCFeedFormatter' => 'includes/rcfeed/IRCColourfulRCFeedFormatter.php',
index 880f05a..cc694a3 100644 (file)
@@ -5559,6 +5559,7 @@ $wgRCFeeds = array();
  * Keys are scheme names, values are names of engine classes.
  */
 $wgRCEngines = array(
+       'redis' => 'RedisPubSubFeedEngine',
        'udp' => 'UDPRCFeedEngine',
 );
 
index a620f88..db090a9 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 /**
- * @brief Class for an OpenStack Swift based file backend.
+ * @brief Class for an OpenStack Swift (or Ceph RGW) based file backend.
  *
  * This requires the SwiftCloudFiles MediaWiki extension, which includes
  * the php-cloudfiles library (https://github.com/rackspace/php-cloudfiles).
diff --git a/includes/rcfeed/RedisPubSubFeedEngine.php b/includes/rcfeed/RedisPubSubFeedEngine.php
new file mode 100644 (file)
index 0000000..4bcc133
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+class RedisPubSubFeedEngine implements RCFeedEngine {
+       /**
+        * Emit a recent change notification via Redis Pub/Sub
+        *
+        * If the feed URI contains a path component, it will be used to generate a
+        * channel name by stripping the leading slash and replacing any remaining
+        * slashes with '.'. If no path component is present, the channel is set to
+        * 'rc'. If the URI contains a query string, its parameters will be parsed
+        * as RedisConnectionPool options.
+        *
+        * @example $wgRCFeeds['redis'] = array(
+        *      'formatter' => 'JSONRCFeedFormatter',
+        *      'uri'       => "redis://127.0.0.1:6379/rc.$wgDBname",
+        * );
+        *
+        * @since 1.22
+        */
+       public function send( array $feed, $line ) {
+               $parsed = parse_url( $feed['uri'] );
+               $server = $parsed['host'];
+               $options = array( 'serializer' => 'none' );
+               $channel = 'rc';
+
+               if ( isset( $parsed['port'] ) ) {
+                       $server .= ":{$parsed['port']}";
+               }
+               if ( isset( $parsed['query'] ) ) {
+                       parse_str( $parsed['query'], $options );
+               }
+               if ( isset( $parsed['pass'] ) ) {
+                       $options['password'] = $parsed['pass'];
+               }
+               if ( isset( $parsed['path'] ) ) {
+                       $channel = str_replace( '/', '.', ltrim( $parsed['path'], '/' ) );
+               }
+               $pool = RedisConnectionPool::singleton( $options );
+               $conn = $pool->getConnection( $server );
+               $conn->publish( $channel, $line );
+       }
+}
index 5d9e554..0f910a5 100644 (file)
@@ -227,7 +227,8 @@ class SpecialContributions extends SpecialPage {
         * Generates the subheading with links
         * @param $userObj User object for the target
         * @return String: appropriately-escaped HTML to be output literally
-        * @todo FIXME: Almost the same as getSubTitle in SpecialDeletedContributions.php. Could be combined.
+        * @todo FIXME: Almost the same as getSubTitle in SpecialDeletedContributions.php.
+        * Could be combined.
         */
        protected function contributionsSub( $userObj ) {
                if ( $userObj->isAnon() ) {
@@ -594,9 +595,11 @@ class SpecialContributions extends SpecialPage {
  */
 class ContribsPager extends ReverseChronologicalPager {
        public $mDefaultDirection = true;
-       var $messages, $target;
-       var $namespace = '', $mDb;
-       var $preventClickjacking = false;
+       public $messages;
+       public $target;
+       public $namespace = '';
+       public $mDb;
+       public $preventClickjacking = false;
 
        /**
         * @var array
@@ -679,8 +682,13 @@ class ContribsPager extends ReverseChronologicalPager {
                 * $limit: see phpdoc above
                 * $descending: see phpdoc above
                 */
-               $data = array( $this->mDb->select( $tables, $fields, $conds, $fname, $options, $join_conds ) );
-               wfRunHooks( 'ContribsPager::reallyDoQuery', array( &$data, $pager, $offset, $limit, $descending ) );
+               $data = array( $this->mDb->select(
+                       $tables, $fields, $conds, $fname, $options, $join_conds
+               ) );
+               wfRunHooks(
+                       'ContribsPager::reallyDoQuery',
+                       array( &$data, $pager, $offset, $limit, $descending )
+               );
 
                $result = array();
 
@@ -944,7 +952,11 @@ class ContribsPager extends ReverseChronologicalPager {
                                $chardiff .= Linker::formatRevisionSize( $row->rev_len );
                                $chardiff .= ' <span class="mw-changeslist-separator">. .</span> ';
                        } else {
-                               $parentLen = isset( $this->mParentLens[$row->rev_parent_id] ) ? $this->mParentLens[$row->rev_parent_id] : 0;
+                               $parentLen = 0;
+                               if ( isset( $this->mParentLens[$row->rev_parent_id] ) ) {
+                                       $this->mParentLens[$row->rev_parent_id];
+                               }
+
                                $chardiff = ' <span class="mw-changeslist-separator">. .</span> ';
                                $chardiff .= ChangesList::showCharacterDifference(
                                        $parentLen,
@@ -1001,11 +1013,14 @@ class ContribsPager extends ReverseChronologicalPager {
                        $diffHistLinks = $this->msg( 'parentheses' )
                                ->rawParams( $difftext . $this->messages['pipe-separator'] . $histlink )
                                ->escaped();
-                       $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}";
+                       $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} ";
+                       $ret .= "{$link}{$userlink} {$comment} {$topmarktext}";
 
                        # Denote if username is redacted for this edit
                        if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
-                               $ret .= " <strong>" . $this->msg( 'rev-deleted-user-contribs' )->escaped() . "</strong>";
+                               $ret .= " <strong>" .
+                                       $this->msg( 'rev-deleted-user-contribs' )->escaped() .
+                                       "</strong>";
                        }
 
                        # Tags, if any.
index 2cf1730..9b9888a 100644 (file)
  */
 class DeletedContribsPager extends IndexPager {
        public $mDefaultDirection = true;
-       var $messages, $target;
-       var $namespace = '', $mDb;
+       public $messages;
+       public $target;
+       public $namespace = '';
+       public $mDb;
 
        /**
         * @var string Navigation bar with paging links.
@@ -358,9 +360,9 @@ class DeletedContributionsPage extends SpecialPage {
                # If there were contributions, and it was a valid user or IP, show
                # the appropriate "footer" message - WHOIS tools, etc.
                if ( $target != 'newbies' ) {
-                       $message = IP::isIPAddress( $target )
-                               ? 'sp-contributions-footer-anon'
-                               'sp-contributions-footer';
+                       $message = IP::isIPAddress( $target ) ?
+                               'sp-contributions-footer-anon' :
+                               'sp-contributions-footer';
 
                        if ( !$this->msg( $message )->isDisabled() ) {
                                $out->wrapWikiMsg(
index 2294804..a198832 100644 (file)
@@ -1,8 +1,6 @@
 <?php
 
 class XmlTest extends MediaWikiTestCase {
-       private static $oldLang;
-       private static $oldNamespaces;
 
        protected function setUp() {
                parent::setUp();
@@ -33,6 +31,9 @@ class XmlTest extends MediaWikiTestCase {
                ) );
        }
 
+       /**
+        * @covers Xml::expandAttributes
+        */
        public function testExpandAttributes() {
                $this->assertNull( Xml::expandAttributes( null ),
                        'Converting a null list of attributes'
@@ -42,11 +43,17 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::expandAttributes
+        */
        public function testExpandAttributesException() {
                $this->setExpectedException( 'MWException' );
                Xml::expandAttributes( 'string' );
        }
 
+       /**
+        * @covers Xml::element
+        */
        function testElementOpen() {
                $this->assertEquals(
                        '<element>',
@@ -55,6 +62,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::element
+        */
        function testElementEmpty() {
                $this->assertEquals(
                        '<element />',
@@ -63,6 +73,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::input
+        */
        function testElementInputCanHaveAValueOfZero() {
                $this->assertEquals(
                        '<input name="name" value="0" />',
@@ -71,6 +84,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::element
+        */
        function testElementEscaping() {
                $this->assertEquals(
                        '<element>hello &lt;there&gt; you &amp; you</element>',
@@ -79,12 +95,18 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::escapeTagsOnly
+        */
        public function testEscapeTagsOnly() {
                $this->assertEquals( '&quot;&gt;&lt;', Xml::escapeTagsOnly( '"><' ),
                        'replace " > and < with their HTML entitites'
                );
        }
 
+       /**
+        * @covers Xml::element
+        */
        function testElementAttributes() {
                $this->assertEquals(
                        '<element key="value" <>="&lt;&gt;">',
@@ -93,6 +115,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::openElement
+        */
        function testOpenElement() {
                $this->assertEquals(
                        '<element k="v">',
@@ -101,10 +126,16 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::closeElement
+        */
        function testCloseElement() {
                $this->assertEquals( '</element>', Xml::closeElement( 'element' ), 'closeElement() shortcut' );
        }
 
+       /**
+        * @covers Xml::dateMenu
+        */
        public function testDateMenu() {
                $curYear = intval( gmdate( 'Y' ) );
                $prevYear = $curYear - 1;
@@ -185,9 +216,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
-       #
-       textarea
-       #
+       /**
+        * @covers Xml::textarea
+        */
        function testTextareaNoContent() {
                $this->assertEquals(
                        '<textarea name="name" id="name" cols="40" rows="5"></textarea>',
@@ -196,6 +227,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::textarea
+        */
        function testTextareaAttribs() {
                $this->assertEquals(
                        '<textarea name="name" id="name" cols="20" rows="10">&lt;txt&gt;</textarea>',
@@ -204,9 +238,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
-       #
-       # input and label
-       #
+       /**
+        * @covers Xml::label
+        */
        function testLabelCreation() {
                $this->assertEquals(
                        '<label for="id">name</label>',
@@ -215,6 +249,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::label
+        */
        function testLabelAttributeCanOnlyBeClassOrTitle() {
                $this->assertEquals(
                        '<label for="id">name</label>',
@@ -244,6 +281,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::languageSelector
+        */
        function testLanguageSelector() {
                $select = Xml::languageSelector( 'en', true, null,
                        array( 'id' => 'testlang' ), wfMessage( 'yourlanguage' ) );
@@ -253,9 +293,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
-       #
-       # JS
-       #
+       /**
+        * @covers Xml::escapeJsString
+        */
        function testEscapeJsStringSpecialChars() {
                $this->assertEquals(
                        '\\\\\r\n',
@@ -264,6 +304,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarBoolean() {
                $this->assertEquals(
                        'true',
@@ -272,6 +315,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarNull() {
                $this->assertEquals(
                        'null',
@@ -280,6 +326,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarArray() {
                $this->assertEquals(
                        '["a",1]',
@@ -293,6 +342,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarObject() {
                $this->assertEquals(
                        '{"a":"a","b":1}',
@@ -301,6 +353,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarInt() {
                $this->assertEquals(
                        '123456',
@@ -309,6 +364,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarFloat() {
                $this->assertEquals(
                        '1.23456',
@@ -317,6 +375,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarIntString() {
                $this->assertEquals(
                        '"123456"',
@@ -325,6 +386,9 @@ class XmlTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Xml::encodeJsVar
+        */
        function testEncodeJsVarFloatString() {
                $this->assertEquals(
                        '"1.23456"',
index 3fea57a..59c7047 100644 (file)
@@ -1,5 +1,9 @@
 <?php
 
+/**
+ * @covers ZipDirectoryReader
+ * NOTE: this test is more like an integration test than a unit test
+ */
 class ZipDirectoryReaderTest extends MediaWikiTestCase {
        var $zipDir, $entries;
 
index c19b54e..3926e85 100644 (file)
@@ -364,7 +364,7 @@ class ApiEditPageTest extends ApiTestCase {
 
                /*
                * bug 41990: if the target page has a newer revision than the redirect, then editing the
-               * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erronously
+               * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erroneously
                * caused an edit conflict to be detected.
                */
 
index 013bbe2..fcfa724 100644 (file)
@@ -6,7 +6,13 @@
  * @group medium
  */
 class FileBackendTest extends MediaWikiTestCase {
-       private $backend, $multiBackend;
+
+       /** @var FileBackend */
+       private $backend;
+       /** @var FileBackendMultiWrite */
+       private $multiBackend;
+       /** @var FSFileBackend */
+       public $singleBackend;
        private $filesToPrune = array();
        private static $backendToUse;
 
@@ -85,6 +91,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testIsStoragePath
+        * @covers FileBackend::isStoragePath
         */
        public function testIsStoragePath( $path, $isStorePath ) {
                $this->assertEquals( $isStorePath, FileBackend::isStoragePath( $path ),
@@ -109,6 +116,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testSplitStoragePath
+        * @covers FileBackend::splitStoragePath
         */
        public function testSplitStoragePath( $path, $res ) {
                $this->assertEquals( $res, FileBackend::splitStoragePath( $path ),
@@ -133,6 +141,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_normalizeStoragePath
+        * @covers FileBackend::normalizeStoragePath
         */
        public function testNormalizeStoragePath( $path, $res ) {
                $this->assertEquals( $res, FileBackend::normalizeStoragePath( $path ),
@@ -159,6 +168,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testParentStoragePath
+        * @covers FileBackend::parentStoragePath
         */
        public function testParentStoragePath( $path, $res ) {
                $this->assertEquals( $res, FileBackend::parentStoragePath( $path ),
@@ -180,6 +190,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testExtensionFromPath
+        * @covers FileBackend::extensionFromPath
         */
        public function testExtensionFromPath( $path, $res ) {
                $this->assertEquals( $res, FileBackend::extensionFromPath( $path ),
@@ -213,6 +224,9 @@ class FileBackendTest extends MediaWikiTestCase {
                $this->tearDownFiles();
        }
 
+       /**
+        * @covers FileBackend::doOperation
+        */
        private function doTestStore( $op ) {
                $backendName = $this->backendClass();
 
@@ -284,6 +298,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testCopy
+        * @covers FileBackend::doOperation
         */
        public function testCopy( $op ) {
                $this->backend = $this->singleBackend;
@@ -404,6 +419,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testMove
+        * @covers FileBackend::doOperation
         */
        public function testMove( $op ) {
                $this->backend = $this->singleBackend;
@@ -525,6 +541,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testDelete
+        * @covers FileBackend::doOperation
         */
        public function testDelete( $op, $withSource, $okStatus ) {
                $this->backend = $this->singleBackend;
@@ -616,6 +633,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testDescribe
+        * @covers FileBackend::doOperation
         */
        public function testDescribe( $op, $withSource, $okStatus ) {
                $this->backend = $this->singleBackend;
@@ -683,6 +701,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testCreate
+        * @covers FileBackend::doOperation
         */
        public function testCreate( $op, $alreadyExists, $okStatus, $newSize ) {
                $this->backend = $this->singleBackend;
@@ -803,6 +822,9 @@ class FileBackendTest extends MediaWikiTestCase {
                return $cases;
        }
 
+       /**
+        * @covers FileBackend::doQuickOperations
+        */
        public function testDoQuickOperations() {
                $this->backend = $this->singleBackend;
                $this->doTestDoQuickOperations();
@@ -1019,6 +1041,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testGetFileStat
+        * @covers FileBackend::getFileStat
         */
        public function testGetFileStat( $path, $content, $alreadyExists ) {
                $this->backend = $this->singleBackend;
@@ -1094,6 +1117,8 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testGetFileContents
+        * @covers FileBackend::getFileContents
+        * @covers FileBackend::getFileContentsMulti
         */
        public function testGetFileContents( $source, $content ) {
                $this->backend = $this->singleBackend;
@@ -1153,6 +1178,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testGetLocalCopy
+        * @covers FileBackend::getLocalCopy
         */
        public function testGetLocalCopy( $source, $content ) {
                $this->backend = $this->singleBackend;
@@ -1222,6 +1248,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testGetLocalReference
+        * @covers FileBackend::getLocalReference
         */
        public function testGetLocalReference( $source, $content ) {
                $this->backend = $this->singleBackend;
@@ -1286,6 +1313,10 @@ class FileBackendTest extends MediaWikiTestCase {
                return $cases;
        }
 
+       /**
+        * @covers FileBackend::getLocalCopy
+        * @covers FileBackend::getLocalReference
+        */
        public function testGetLocalCopyAndReference404() {
                $this->backend = $this->singleBackend;
                $this->tearDownFiles();
@@ -1314,6 +1345,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testGetFileHttpUrl
+        * @covers FileBackend::getFileHttpUrl
         */
        public function testGetFileHttpUrl( $source, $content ) {
                $this->backend = $this->singleBackend;
@@ -1358,6 +1390,8 @@ class FileBackendTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_testPrepareAndClean
+        * @covers FileBackend::prepare
+        * @covers FileBackend::clean
         */
        public function testPrepareAndClean( $path, $isOK ) {
                $this->backend = $this->singleBackend;
@@ -1416,6 +1450,9 @@ class FileBackendTest extends MediaWikiTestCase {
                $this->tearDownFiles();
        }
 
+       /**
+        * @covers FileBackend::clean
+        */
        private function doTestRecursiveClean() {
                $backendName = $this->backendClass();
 
@@ -1462,6 +1499,9 @@ class FileBackendTest extends MediaWikiTestCase {
 
        // @todo testSecure
 
+       /**
+        * @covers FileBackend::doOperations
+        */
        public function testDoOperations() {
                $this->backend = $this->singleBackend;
                $this->tearDownFiles();
@@ -1549,6 +1589,9 @@ class FileBackendTest extends MediaWikiTestCase {
                        "Correct file SHA-1 of $fileC" );
        }
 
+       /**
+        * @covers FileBackend::doOperations
+        */
        public function testDoOperationsPipeline() {
                $this->backend = $this->singleBackend;
                $this->tearDownFiles();
@@ -1648,6 +1691,9 @@ class FileBackendTest extends MediaWikiTestCase {
                        "Correct file SHA-1 of $fileC" );
        }
 
+       /**
+        * @covers FileBackend::doOperations
+        */
        public function testDoOperationsFailing() {
                $this->backend = $this->singleBackend;
                $this->tearDownFiles();
@@ -1722,6 +1768,9 @@ class FileBackendTest extends MediaWikiTestCase {
                        "Correct file SHA-1 of $fileA" );
        }
 
+       /**
+        * @covers FileBackend::getFileList
+        */
        public function testGetFileList() {
                $this->backend = $this->singleBackend;
                $this->tearDownFiles();
@@ -1886,6 +1935,10 @@ class FileBackendTest extends MediaWikiTestCase {
                }
        }
 
+       /**
+        * @covers FileBackend::getTopDirectoryList
+        * @covers FileBackend::getDirectoryList
+        */
        public function testGetDirectoryList() {
                $this->backend = $this->singleBackend;
                $this->tearDownFiles();
@@ -2092,6 +2145,10 @@ class FileBackendTest extends MediaWikiTestCase {
                $this->assertEquals( array(), $items, "Directory listing is empty." );
        }
 
+       /**
+        * @covers FileBackend::lockFiles
+        * @covers FileBackend::unlockFiles
+        */
        public function testLockCalls() {
                $this->backend = $this->singleBackend;
                $this->doTestLockCalls();
index 033ae0b..b760e26 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
 class FileRepoTest extends MediaWikiTestCase {
+
        /**
         * @expectedException MWException
+        * @covers FileRepo::__construct
         */
        function testFileRepoConstructionOptionCanNotBeNull() {
                new FileRepo();
@@ -10,6 +12,7 @@ class FileRepoTest extends MediaWikiTestCase {
 
        /**
         * @expectedException MWException
+        * @covers FileRepo::__construct
         */
        function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
                new FileRepo( array() );
@@ -17,6 +20,7 @@ class FileRepoTest extends MediaWikiTestCase {
 
        /**
         * @expectedException MWException
+        * @covers FileRepo::__construct
         */
        function testFileRepoConstructionOptionNeedNameKey() {
                new FileRepo( array(
@@ -26,6 +30,7 @@ class FileRepoTest extends MediaWikiTestCase {
 
        /**
         * @expectedException MWException
+        * @covers FileRepo::__construct
         */
        function testFileRepoConstructionOptionNeedBackendKey() {
                new FileRepo( array(
@@ -33,6 +38,9 @@ class FileRepoTest extends MediaWikiTestCase {
                ) );
        }
 
+       /**
+        * @covers FileRepo::__construct
+        */
        function testFileRepoConstructionWithRequiredOptions() {
                $f = new FileRepo( array(
                        'name' => 'FileRepoTestRepository',
index 71a585e..b33c1bb 100644 (file)
@@ -1,10 +1,16 @@
 <?php
+
 /**
  * @group FileRepo
  * @group medium
  */
 class StoreBatchTest extends MediaWikiTestCase {
 
+       protected $createdFiles;
+       protected $date;
+       /** @var FileRepo */
+       protected $repo;
+
        protected function setUp() {
                global $wgFileBackends;
                parent::setUp();
@@ -60,6 +66,7 @@ class StoreBatchTest extends MediaWikiTestCase {
         * @param $originalName string The title of the image
         * @param $srcPath string The filepath or virtual URL
         * @param $flags integer Flags to pass into repo::store().
+        * @return FileRepoStatus
         */
        private function storeit( $originalName, $srcPath, $flags ) {
                $hashPath = $this->repo->getHashPath( $originalName );
@@ -79,7 +86,7 @@ class StoreBatchTest extends MediaWikiTestCase {
         * @param $fn string The title of the image
         * @param $infn string The name of the file (in the filesystem)
         * @param $otherfn string The name of the different file (in the filesystem)
-        * @param $fromrepo logical 'true' if we want to copy from a virtual URL out of the Repo.
+        * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo.
         */
        private function storecohort( $fn, $infn, $otherfn, $fromrepo ) {
                $f = $this->storeit( $fn, $infn, 0 );
@@ -116,6 +123,9 @@ class StoreBatchTest extends MediaWikiTestCase {
                $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" );
        }
 
+       /**
+        * @covers FileRepo::store
+        */
        public function teststore() {
                global $IP;
                $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", false );
index 7c37f98..592500d 100644 (file)
@@ -11,6 +11,7 @@ class OracleInstallerTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provideOracleConnectStrings
+        * @covers OracleInstaller::checkConnectStringFormat
         */
        function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) {
                $validity = $expected ? 'should be valid' : 'should NOT be valid';
index e0092a5..c5d52d3 100644 (file)
@@ -54,6 +54,7 @@ class MediaWikiSiteTest extends SiteTest {
 
        /**
         * @dataProvider fileUrlProvider
+        * @covers MediaWikiSite::getFileUrl
         */
        public function testGetFileUrl( $url, $filePath, $pathArgument, $expected ) {
                $site = new MediaWikiSite();
@@ -77,6 +78,7 @@ class MediaWikiSiteTest extends SiteTest {
 
        /**
         * @dataProvider provideGetPageUrl
+        * @covers MediaWikiSite::getPageUrl
         */
        public function testGetPageUrl( $path, $page, $expected ) {
                $site = new MediaWikiSite();
index bd2ae07..8af2fc1 100644 (file)
@@ -68,6 +68,7 @@ class SiteListTest extends MediaWikiTestCase {
        /**
         * @dataProvider siteListProvider
         * @param SiteList $sites
+        * @covers SiteList::isEmpty
         */
        public function testIsEmpty( SiteList $sites ) {
                $this->assertEquals( count( $sites ) === 0, $sites->isEmpty() );
@@ -76,6 +77,7 @@ class SiteListTest extends MediaWikiTestCase {
        /**
         * @dataProvider siteListProvider
         * @param SiteList $sites
+        * @covers SiteList::getSite
         */
        public function testGetSiteByGlobalId( SiteList $sites ) {
                if ( $sites->isEmpty() ) {
@@ -93,6 +95,7 @@ class SiteListTest extends MediaWikiTestCase {
        /**
         * @dataProvider siteListProvider
         * @param SiteList $sites
+        * @covers SiteList::getSiteByInternalId
         */
        public function testGetSiteByInternalId( $sites ) {
                /**
@@ -110,6 +113,7 @@ class SiteListTest extends MediaWikiTestCase {
        /**
         * @dataProvider siteListProvider
         * @param SiteList $sites
+        * @covers SiteList::hasSite
         */
        public function testHasGlobalId( $sites ) {
                $this->assertFalse( $sites->hasSite( 'non-existing-global-id' ) );
@@ -128,6 +132,7 @@ class SiteListTest extends MediaWikiTestCase {
        /**
         * @dataProvider siteListProvider
         * @param SiteList $sites
+        * @covers SiteList::hasInternalId
         */
        public function testHasInternallId( $sites ) {
                /**
@@ -145,6 +150,7 @@ class SiteListTest extends MediaWikiTestCase {
        /**
         * @dataProvider siteListProvider
         * @param SiteList $sites
+        * @covers SiteList::getGlobalIdentifiers
         */
        public function testGetGlobalIdentifiers( SiteList $sites ) {
                $identifiers = $sites->getGlobalIdentifiers();
@@ -169,6 +175,8 @@ class SiteListTest extends MediaWikiTestCase {
         * @since 1.21
         *
         * @param SiteList $list
+        * @covers SiteList::getSerializationData
+        * @covers SiteList::unserialize
         */
        public function testSerialization( SiteList $list ) {
                $serialization = serialize( $list );
index cf652e9..6002c1a 100644 (file)
@@ -32,6 +32,9 @@
  */
 class SiteSQLStoreTest extends MediaWikiTestCase {
 
+       /**
+        * @covers SiteSQLStore::getSites
+        */
        public function testGetSites() {
                $expectedSites = TestSites::getSites();
                TestSites::insertIntoDb();
@@ -56,6 +59,9 @@ class SiteSQLStoreTest extends MediaWikiTestCase {
                }
        }
 
+       /**
+        * @covers SiteSQLStore::saveSites
+        */
        public function testSaveSites() {
                $store = SiteSQLStore::newInstance();
 
@@ -86,6 +92,9 @@ class SiteSQLStoreTest extends MediaWikiTestCase {
                $this->assertTrue( $site->getInternalId() >= 0 );
        }
 
+       /**
+        * @covers SiteSQLStore::reset
+        */
        public function testReset() {
                $store1 = SiteSQLStore::newInstance();
                $store2 = SiteSQLStore::newInstance();
@@ -109,6 +118,9 @@ class SiteSQLStoreTest extends MediaWikiTestCase {
                $this->assertNull( $site );
        }
 
+       /**
+        * @covers SiteSQLStore::clear
+        */
        public function testClear() {
                $store = SiteSQLStore::newInstance();
                $this->assertTrue( $store->clear() );
index b453e74..29c1ff3 100644 (file)
@@ -38,6 +38,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getInterwikiIds
         */
        public function testGetInterwikiIds( Site $site ) {
                $this->assertInternalType( 'array', $site->getInterwikiIds() );
@@ -46,6 +47,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getNavigationIds
         */
        public function testGetNavigationIds( Site $site ) {
                $this->assertInternalType( 'array', $site->getNavigationIds() );
@@ -54,6 +56,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::addNavigationId
         */
        public function testAddNavigationId( Site $site ) {
                $site->addNavigationId( 'foobar' );
@@ -63,6 +66,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::addInterwikiId
         */
        public function testAddInterwikiId( Site $site ) {
                $site->addInterwikiId( 'foobar' );
@@ -72,6 +76,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getLanguageCode
         */
        public function testGetLanguageCode( Site $site ) {
                $this->assertTypeOrValue( 'string', $site->getLanguageCode(), null );
@@ -80,6 +85,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::setLanguageCode
         */
        public function testSetLanguageCode( Site $site ) {
                $site->setLanguageCode( 'en' );
@@ -89,6 +95,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::normalizePageName
         */
        public function testNormalizePageName( Site $site ) {
                $this->assertInternalType( 'string', $site->normalizePageName( 'Foobar' ) );
@@ -97,6 +104,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getGlobalId
         */
        public function testGetGlobalId( Site $site ) {
                $this->assertTypeOrValue( 'string', $site->getGlobalId(), null );
@@ -105,6 +113,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::setGlobalId
         */
        public function testSetGlobalId( Site $site ) {
                $site->setGlobalId( 'foobar' );
@@ -114,6 +123,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getType
         */
        public function testGetType( Site $site ) {
                $this->assertInternalType( 'string', $site->getType() );
@@ -122,6 +132,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getPath
         */
        public function testGetPath( Site $site ) {
                $this->assertTypeOrValue( 'string', $site->getPath( 'page_path' ), null );
@@ -132,6 +143,7 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::getAllPaths
         */
        public function testGetAllPaths( Site $site ) {
                $this->assertInternalType( 'array', $site->getAllPaths() );
@@ -140,6 +152,8 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::setPath
+        * @covers Site::removePath
         */
        public function testSetAndRemovePath( Site $site ) {
                $count = count( $site->getAllPaths() );
@@ -162,6 +176,9 @@ class SiteTest extends MediaWikiTestCase {
                $this->assertNull( $site->getPath( 'spam' ) );
        }
 
+       /**
+        * @covers Site::setLinkPath
+        */
        public function testSetLinkPath() {
                $site = new Site();
                $path = "TestPath/$1";
@@ -170,6 +187,9 @@ class SiteTest extends MediaWikiTestCase {
                $this->assertEquals( $path, $site->getLinkPath() );
        }
 
+       /**
+        * @covers Site::getLinkPathType
+        */
        public function testGetLinkPathType() {
                $site = new Site();
 
@@ -182,6 +202,9 @@ class SiteTest extends MediaWikiTestCase {
                $this->assertEquals( $path, $site->getLinkPath() );
        }
 
+       /**
+        * @covers Site::setPath
+        */
        public function testSetPath() {
                $site = new Site();
 
@@ -191,6 +214,10 @@ class SiteTest extends MediaWikiTestCase {
                $this->assertEquals( $path, $site->getPath( 'foo' ) );
        }
 
+       /**
+        * @covers Site::setPath
+        * @covers Site::getProtocol
+        */
        public function testProtocolRelativePath() {
                $site = new Site();
 
@@ -228,6 +255,7 @@ class SiteTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provideGetPageUrl
+        * @covers Site::getPageUrl
         */
        public function testGetPageUrl( $path, $page, $expected ) {
                $site = new Site();
@@ -252,6 +280,8 @@ class SiteTest extends MediaWikiTestCase {
        /**
         * @dataProvider instanceProvider
         * @param Site $site
+        * @covers Site::serialize
+        * @covers Site::unserialize
         */
        public function testSerialization( Site $site ) {
                $this->assertInstanceOf( 'Serializable', $site );
index 298420b..982b46b 100644 (file)
@@ -1,10 +1,12 @@
 <?php
+
 /**
  * @group Upload
  */
 class UploadBaseTest extends MediaWikiTestCase {
-       protected $upload;
 
+       /** @var UploadTestHandler */
+       protected $upload;
 
        protected function setUp() {
                global $wgHooks;
@@ -30,6 +32,7 @@ class UploadBaseTest extends MediaWikiTestCase {
         * of UploadBase::getTitle() and then the actual returned title
         *
         * @dataProvider provideTestTitleValidation
+        * @covers UploadBase::getTitle
         */
        public function testTitleValidation( $srcFilename, $dstFilename, $code, $msg ) {
                /* Check the result code */
@@ -82,6 +85,7 @@ class UploadBaseTest extends MediaWikiTestCase {
 
        /**
         * Test the upload verification functions
+        * @covers UploadBase::verifyUpload
         */
        public function testVerifyUpload() {
                /* Setup with zero file size */
@@ -108,7 +112,6 @@ class UploadBaseTest extends MediaWikiTestCase {
         *
         * This method should be abstracted so we can test different settings.
         */
-
        public function testMaxUploadSize() {
                global $wgMaxUploadSize;
                $savedGlobal = $wgMaxUploadSize; // save global