X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitleTest.php;h=913f56de5549d70b17667cb996110adcbe2f9a46;hp=4ffef02d19b6fe020301aa26e79eb29ddf4c6077;hb=6cfb2e3d7a2b96d5041312fcec88248bb46573d7;hpb=c9db90712628d43573f47a2b32dca0778cd8f1f7 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' ) ],