<?php
-class SpecialBooksourcesTest extends MediaWikiTestCase {
+class SpecialBooksourcesTest extends SpecialPageTestBase {
public static function provideISBNs() {
return [
[ '978-0-300-14424-6', true ],
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 );
+ }
}