Merge "SVGMetadataExtractorTest: remove method existence test"
[lhc/web/wiklou.git] / tests / phpunit / includes / TitleTest.php
index d585240..4af12a8 100644 (file)
@@ -289,7 +289,6 @@ class TitleTest extends MediaWikiTestCase {
         * @param array|string|bool $expected Required error
         * @dataProvider provideTestIsValidMoveOperation
         * @covers Title::isValidMoveOperation
-        * @covers Title::validateFileMoveOperation
         */
        public function testIsValidMoveOperation( $source, $target, $expected ) {
                $this->setMwGlobals( 'wgContentHandlerUseDB', false );
@@ -315,7 +314,6 @@ class TitleTest extends MediaWikiTestCase {
                        [ 'Test', 'Special:FooBar', 'immobile-target-namespace' ],
                        [ 'MediaWiki:Common.js', 'Help:Some wikitext page', 'bad-target-model' ],
                        [ 'Page', 'File:Test.jpg', 'nonfile-cannot-move-to-file' ],
-                       // for Title::validateFileMoveOperation
                        [ 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ],
                ];
        }
@@ -730,18 +728,6 @@ class TitleTest extends MediaWikiTestCase {
                $this->assertSame( $expected, $actual, $title->getPrefixedDBkey() );
        }
 
-       /**
-        * @dataProvider provideCanHaveTalkPage
-        * @covers Title::canTalk
-        *
-        * @param Title $title
-        * @param bool $expected
-        */
-       public function testCanTalk( Title $title, $expected ) {
-               $actual = $title->canTalk();
-               $this->assertSame( $expected, $actual, $title->getPrefixedDBkey() );
-       }
-
        public static function provideGetTalkPage_good() {
                return [
                        [ Title::makeTitle( NS_MAIN, 'Test' ), Title::makeTitle( NS_TALK, 'Test' ) ],
@@ -967,4 +953,32 @@ class TitleTest extends MediaWikiTestCase {
                        [ 'zz:Foo#ั‚ะตัั‚', '#.D1.82.D0.B5.D1.81.D1.82' ],
                ];
        }
+
+       /**
+        * @covers Title::isRawHtmlMessage
+        * @dataProvider provideIsRawHtmlMessage
+        */
+       public function testIsRawHtmlMessage( $textForm, $expected ) {
+               $this->setMwGlobals( 'wgRawHtmlMessages', [
+                       'foobar',
+                       'foo_bar',
+                       'foo-bar',
+               ] );
+
+               $title = Title::newFromText( $textForm );
+               $this->assertSame( $expected, $title->isRawHtmlMessage() );
+       }
+
+       public function provideIsRawHtmlMessage() {
+               return [
+                       [ 'MediaWiki:Foobar', true ],
+                       [ 'MediaWiki:Foo bar', true ],
+                       [ 'MediaWiki:Foo-bar', true ],
+                       [ 'MediaWiki:foo bar', true ],
+                       [ 'MediaWiki:foo-bar', true ],
+                       [ 'MediaWiki:foobar', true ],
+                       [ 'MediaWiki:some-other-message', false ],
+                       [ 'Main Page', false ],
+               ];
+       }
 }