35 private function getGenderCache() {
36 $genderCache = $this->getMockBuilder(
'GenderCache' )
37 ->disableOriginalConstructor()
40 $genderCache->expects( $this->any() )
41 ->method(
'getGenderOf' )
42 ->will( $this->returnValue(
'female' ) );
47 public function provideGetPageUrl() {
56 array(
'foo' =>
'bar' ),
57 '/User:Hansi_Maier?foo=bar#stuff'
77 $this->assertEquals( $url, $actual );
80 public function provideRenderHtmlLink() {
85 '!<a .*href=".*?Foo_Bar.*?".*?>Foo Bar</a>!'
91 'Hansi Maier\'s Stuff',
92 '!<a .*href=".*?User:Hansi_Maier.*?>Hansi Maier\'s Stuff</a>!'
99 '!<a .*href=".*?User:Hansi_Maier.*?>User:Hansi Maier#stuff</a>!'
117 $actual = $renderer->renderHtmlLink(
$title, $text );
119 $this->assertRegExp( $pattern, $actual );
122 public function provideRenderWikitextLink() {
127 '[[:0:Foo Bar|Foo Bar]]'
131 'Hansi Maier\'s Stuff',
132 '[[:2:Hansi Maier#stuff|Hansi Maier's Stuff]]'
137 '[[:2:Hansi Maier#stuff|2:Hansi Maier#stuff]]'
145 public function testRenderWikitextLink(
TitleValue $title, $text, $expected ) {
146 $formatter = $this->getMock(
'TitleFormatter' );
147 $formatter->expects( $this->any() )
148 ->method(
'getFullText' )
149 ->will( $this->returnCallback(
151 return str_replace(
'_',
' ',
"$title" );
156 $actual = $renderer->renderWikitextLink(
$title, $text );
158 $this->assertEquals( $expected, $actual );