Merge "JavaScriptMinifier: Enable phpcs and fix violations"
[lhc/web/wiklou.git] / tests / phpunit / includes / TitleArrayFromResultTest.php
index 832316e..8882214 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 
 /**
- * @author Adam Shorland
+ * @author Addshore
  * @covers TitleArrayFromResult
  */
-class TitleArrayFromResultTest extends MediaWikiTestCase {
+class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
 
        private function getMockResultWrapper( $row = null, $numRows = 1 ) {
                $resultWrapper = $this->getMockBuilder( 'ResultWrapper' )
@@ -64,12 +66,12 @@ class TitleArrayFromResultTest extends MediaWikiTestCase {
                $this->assertEquals( $title, $object->current->mTextform );
        }
 
-       public function provideNumberOfRows() {
-               return array(
-                       array( 0 ),
-                       array( 1 ),
-                       array( 122 ),
-               );
+       public static function provideNumberOfRows() {
+               return [
+                       [ 0 ],
+                       [ 1 ],
+                       [ 122 ],
+               ];
        }
 
        /**
@@ -77,7 +79,10 @@ class TitleArrayFromResultTest extends MediaWikiTestCase {
         * @covers TitleArrayFromResult::count
         */
        public function testCountWithVaryingValues( $numRows ) {
-               $object = $this->getTitleArrayFromResult( $this->getMockResultWrapper( $this->getRowWithTitle(), $numRows ) );
+               $object = $this->getTitleArrayFromResult( $this->getMockResultWrapper(
+                       $this->getRowWithTitle(),
+                       $numRows
+               ) );
                $this->assertEquals( $numRows, $object->count() );
        }
 
@@ -95,10 +100,10 @@ class TitleArrayFromResultTest extends MediaWikiTestCase {
        }
 
        public function provideTestValid() {
-               return array(
-                       array( $this->getRowWithTitle(), true ),
-                       array( false, false ),
-               );
+               return [
+                       [ $this->getRowWithTitle(), true ],
+                       [ false, false ],
+               ];
        }
 
        /**
@@ -110,7 +115,7 @@ class TitleArrayFromResultTest extends MediaWikiTestCase {
                $this->assertEquals( $expected, $object->valid() );
        }
 
-       //@todo unit test for key()
-       //@todo unit test for next()
-       //@todo unit test for rewind()
+       // @todo unit test for key()
+       // @todo unit test for next()
+       // @todo unit test for rewind()
 }