Merge "ApiQueryRevisions: Fix error message key"
[lhc/web/wiklou.git] / tests / phpunit / includes / specials / SpecialBooksourcesTest.php
index 3310d02..9c71261 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-class SpecialBooksourcesTest extends MediaWikiTestCase {
+class SpecialBooksourcesTest extends SpecialPageTestBase {
        public static function provideISBNs() {
                return [
                        [ '978-0-300-14424-6', true ],
@@ -14,7 +14,7 @@ class SpecialBooksourcesTest extends MediaWikiTestCase {
                        [ '9780136091817', false ],
                        [ '123456789X', true ],
 
-                       // Bug 67021
+                       // T69021
                        [ '1413304541', false ],
                        [ '141330454X', false ],
                        [ '1413304540', true ],
@@ -33,4 +33,19 @@ class SpecialBooksourcesTest extends MediaWikiTestCase {
        public function testIsValidISBN( $isbn, $isValid ) {
                $this->assertSame( $isValid, SpecialBookSources::isValidISBN( $isbn ) );
        }
+
+       protected function newSpecialPage() {
+               return new SpecialBookSources();
+       }
+
+       /**
+        * @covers SpecialBookSources::execute
+        */
+       public function testExecute() {
+               list( $html, ) = $this->executeSpecialPage( 'Invalid', null, 'qqx' );
+               $this->assertContains( '(booksources-invalid-isbn)', $html );
+               list( $html, ) = $this->executeSpecialPage( '0-7475-3269-9', null, 'qqx' );
+               $this->assertNotContains( '(booksources-invalid-isbn)', $html );
+               $this->assertContains( '(booksources-text)', $html );
+       }
 }