X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitleTest.php;h=913f56de5549d70b17667cb996110adcbe2f9a46;hb=bd5a37aacf600bdd5f3a6e7998f92bd1d9326a8a;hp=4ffef02d19b6fe020301aa26e79eb29ddf4c6077;hpb=ad4c7e66d90f4d34102b39ddcce045af3ec40e36;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 4ffef02d19..913f56de55 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -1,5 +1,6 @@ getMock( InterwikiLookup::class ); + $interwikiLookup->expects( $this->any() ) + ->method( 'isValidInterwiki' ) + ->willReturnCallback( + function ( $prefix ) { + return $prefix == 'wiki'; + } + ); + + $this->setService( 'InterwikiLookup', $interwikiLookup ); + + $title = Title::newFromText( $title ); + $expected = Title::newFromLinkTarget( $expected ); + $actual = $title->getSubpage( $sub ); + + // NOTE: convert to string for comparison + $this->assertSame( $expected->getPrefixedText(), $actual->getPrefixedText(), 'text form' ); + $this->assertTrue( $expected->equals( $actual ), 'Title equality' ); + } + public static function provideNewFromTitleValue() { return [ [ new TitleValue( NS_MAIN, 'Foo' ) ],