Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / tests / phpunit / includes / TitleTest.php
index 7770cbc..b0febe8 100644 (file)
@@ -637,6 +637,28 @@ class TitleTest extends MediaWikiTestCase {
                ];
        }
 
+       /**
+        * @covers Title::isValid
+        * @dataProvider provideIsValid
+        * @param Title $title
+        * @param bool $isValid
+        */
+       public function testIsValid( Title $title, $isValid ) {
+               $this->assertEquals( $isValid, $title->isValid(), $title->getPrefixedText() );
+       }
+
+       public static function provideIsValid() {
+               return [
+                       [ Title::makeTitle( NS_MAIN, '' ), false ],
+                       [ Title::makeTitle( NS_MAIN, '<>' ), false ],
+                       [ Title::makeTitle( NS_MAIN, '|' ), false ],
+                       [ Title::makeTitle( NS_MAIN, '#' ), false ],
+                       [ Title::makeTitle( NS_MAIN, 'Test' ), true ],
+                       [ Title::makeTitle( -33, 'Test' ), false ],
+                       [ Title::makeTitle( 77663399, 'Test' ), false ],
+               ];
+       }
+
        /**
         * @covers Title::isAlwaysKnown
         */