assertSame( $isValid, SpecialBookSources::isValidISBN( $isbn ) ); } protected function newSpecialPage() { $services = MediaWikiServices::getInstance(); return new SpecialBookSources( $services->getRevisionLookup(), $services->getContentLanguage() ); } /** * @covers SpecialBookSources::execute */ public function testExecute() { list( $html, ) = $this->executeSpecialPage( 'Invalid', null, 'qqx' ); $this->assertStringContainsString( '(booksources-invalid-isbn)', $html ); list( $html, ) = $this->executeSpecialPage( '0-7475-3269-9', null, 'qqx' ); $this->assertStringNotContainsString( '(booksources-invalid-isbn)', $html ); $this->assertStringContainsString( '(booksources-text)', $html ); } }