Merge "Adds an --extension option to generateJsonI18n"
[lhc/web/wiklou.git] / tests / phpunit / includes / content / TextContentTest.php
index d7dde37..03cbbc0 100644 (file)
@@ -71,8 +71,11 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataGetParserOutput
+        * @covers TextContent::getParserOutput
         */
-       public function testGetParserOutput( $title, $model, $text, $expectedHtml, $expectedFields = null ) {
+       public function testGetParserOutput( $title, $model, $text, $expectedHtml,
+               $expectedFields = null
+       ) {
                $title = Title::newFromText( $title );
                $content = ContentHandler::makeContent( $text, $title, $model );
 
@@ -116,6 +119,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataPreSaveTransform
+        * @covers TextContent::preSaveTransform
         */
        public function testPreSaveTransform( $text, $expected ) {
                global $wgContLang;
@@ -123,7 +127,11 @@ class TextContentTest extends MediaWikiLangTestCase {
                $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
 
                $content = $this->newContent( $text );
-               $content = $content->preSaveTransform( $this->context->getTitle(), $this->context->getUser(), $options );
+               $content = $content->preSaveTransform(
+                       $this->context->getTitle(),
+                       $this->context->getUser(),
+                       $options
+               );
 
                $this->assertEquals( $expected, $content->getNativeData() );
        }
@@ -139,6 +147,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataPreloadTransform
+        * @covers TextContent::preloadTransform
         */
        public function testPreloadTransform( $text, $expected ) {
                global $wgContLang;
@@ -160,6 +169,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataGetRedirectTarget
+        * @covers TextContent::getRedirectTarget
         */
        public function testGetRedirectTarget( $text, $expected ) {
                $content = $this->newContent( $text );
@@ -174,6 +184,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataGetRedirectTarget
+        * @covers TextContent::isRedirect
         */
        public function testIsRedirect( $text, $expected ) {
                $content = $this->newContent( $text );
@@ -229,6 +240,7 @@ class TextContentTest extends MediaWikiLangTestCase {
        /**
         * @dataProvider dataIsCountable
         * @group Database
+        * @covers TextContent::isCountable
         */
        public function testIsCountable( $text, $hasLinks, $mode, $expected ) {
                $this->setMwGlobals( 'wgArticleCountMethod', $mode );
@@ -237,8 +249,13 @@ class TextContentTest extends MediaWikiLangTestCase {
 
                $v = $content->isCountable( $hasLinks, $this->context->getTitle() );
 
-               $this->assertEquals( $expected, $v, 'isCountable() returned unexpected value ' . var_export( $v, true )
-                       . ' instead of ' . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" );
+               $this->assertEquals(
+                       $expected,
+                       $v,
+                       'isCountable() returned unexpected value ' . var_export( $v, true )
+                               . ' instead of ' . var_export( $expected, true )
+                               . " in mode `$mode` for text \"$text\""
+               );
        }
 
        public static function dataGetTextForSummary() {
@@ -260,6 +277,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataGetTextForSummary
+        * @covers TextContent::getTextForSummary
         */
        public function testGetTextForSummary( $text, $maxlength, $expected ) {
                $content = $this->newContent( $text );
@@ -267,12 +285,18 @@ class TextContentTest extends MediaWikiLangTestCase {
                $this->assertEquals( $expected, $content->getTextForSummary( $maxlength ) );
        }
 
+       /**
+        * @covers TextContent::getTextForSearchIndex
+        */
        public function testGetTextForSearchIndex() {
                $content = $this->newContent( 'hello world.' );
 
                $this->assertEquals( 'hello world.', $content->getTextForSearchIndex() );
        }
 
+       /**
+        * @covers TextContent::copy
+        */
        public function testCopy() {
                $content = $this->newContent( 'hello world.' );
                $copy = $content->copy();
@@ -281,30 +305,45 @@ class TextContentTest extends MediaWikiLangTestCase {
                $this->assertEquals( 'hello world.', $copy->getNativeData() );
        }
 
+       /**
+        * @covers TextContent::getSize
+        */
        public function testGetSize() {
                $content = $this->newContent( 'hello world.' );
 
                $this->assertEquals( 12, $content->getSize() );
        }
 
+       /**
+        * @covers TextContent::getNativeData
+        */
        public function testGetNativeData() {
                $content = $this->newContent( 'hello world.' );
 
                $this->assertEquals( 'hello world.', $content->getNativeData() );
        }
 
+       /**
+        * @covers TextContent::getWikitextForTransclusion
+        */
        public function testGetWikitextForTransclusion() {
                $content = $this->newContent( 'hello world.' );
 
                $this->assertEquals( 'hello world.', $content->getWikitextForTransclusion() );
        }
 
+       /**
+        * @covers TextContent::getModel
+        */
        public function testGetModel() {
                $content = $this->newContent( "hello world." );
 
                $this->assertEquals( CONTENT_MODEL_TEXT, $content->getModel() );
        }
 
+       /**
+        * @covers TextContent::getContentHandler
+        */
        public function testGetContentHandler() {
                $content = $this->newContent( "hello world." );
 
@@ -322,6 +361,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataIsEmpty
+        * @covers TextContent::isEmpty
         */
        public function testIsEmpty( $text, $empty ) {
                $content = $this->newContent( $text );
@@ -341,6 +381,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataEquals
+        * @covers TextContent::equals
         */
        public function testEquals( Content $a, Content $b = null, $equal = false ) {
                $this->assertEquals( $equal, $a->equals( $b ) );
@@ -362,6 +403,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider dataGetDeletionUpdates
+        * @covers TextContent::getDeletionUpdates
         */
        public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) {
                $ns = $this->getDefaultWikitextNS();
@@ -430,6 +472,7 @@ class TextContentTest extends MediaWikiLangTestCase {
 
        /**
         * @dataProvider provideConvert
+        * @covers TextContent::convert
         */
        public function testConvert( $text, $model, $lossy, $expectedNative ) {
                $content = $this->newContent( $text );