X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FLinkerTest.php;h=f4844f89bb4ec12f96bc89ffa7933f3e094ddef0;hb=8956885666e4678a8ff76f7310396d2b2874a858;hp=b7f78803d6d4de395348bf37efeab9dc0b210218;hpb=857817b687edc8b8035db842ed61c2e5b16c5f2d;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php
index b7f78803d6..f4844f89bb 100644
--- a/tests/phpunit/includes/LinkerTest.php
+++ b/tests/phpunit/includes/LinkerTest.php
@@ -37,34 +37,34 @@ class LinkerTest extends MediaWikiLangTestCase {
[
'JohnDoe',
+ . 'title="Special:Contributions/JohnDoe">JohnDoe',
0, 'JohnDoe', false,
],
[
'::1',
+ . 'title="Special:Contributions/::1">::1',
0, '::1', false,
'Anonymous with pretty IPv6'
],
[
'::1',
+ . 'title="Special:Contributions/0:0:0:0:0:0:0:1">::1',
0, '0:0:0:0:0:0:0:1', false,
'Anonymous with almost pretty IPv6'
],
[
'::1',
+ . 'title="Special:Contributions/0000:0000:0000:0000:0000:0000:0000:0001">::1',
0, '0000:0000:0000:0000:0000:0000:0000:0001', false,
'Anonymous with full IPv6'
],
[
'AlternativeUsername',
+ . 'title="Special:Contributions/::1">AlternativeUsername',
0, '::1', 'AlternativeUsername',
'Anonymous with pretty IPv6 and an alternative username'
],
@@ -73,14 +73,14 @@ class LinkerTest extends MediaWikiLangTestCase {
[
'127.0.0.1',
+ . 'title="Special:Contributions/127.0.0.1">127.0.0.1',
0, '127.0.0.1', false,
'Anonymous with IPv4'
],
[
'AlternativeUsername',
+ . 'title="Special:Contributions/127.0.0.1">AlternativeUsername',
0, '127.0.0.1', 'AlternativeUsername',
'Anonymous with IPv4 and an alternative username'
],
@@ -265,7 +265,6 @@ class LinkerTest extends MediaWikiLangTestCase {
* @dataProvider provideCasesForFormatLinksInComment
*/
public function testFormatLinksInComment( $expected, $input, $wiki ) {
-
$conf = new SiteConfiguration();
$conf->settings = [
'wgServer' => [
@@ -307,6 +306,11 @@ class LinkerTest extends MediaWikiLangTestCase {
'foo bar [[Special:BlankPage]]',
'enwiki',
],
+ [
+ 'foo bar Image:Example',
+ 'foo bar [[Image:Example]]',
+ 'enwiki',
+ ],
];
// @codingStandardsIgnoreEnd
}
@@ -385,21 +389,21 @@ class LinkerTest extends MediaWikiLangTestCase {
return [
// Override $html
[
- function( $dummy, $title, $options, &$html, &$attribs, &$ret ) {
+ function ( $dummy, $title, $options, &$html, &$attribs, &$ret ) {
$html = 'foobar';
},
'foobar'
],
// Modify $attribs
[
- function( $dummy, $title, $options, &$html, &$attribs, &$ret ) {
+ function ( $dummy, $title, $options, &$html, &$attribs, &$ret ) {
$attribs['bar'] = 'baz';
},
'Special:BlankPage'
],
// Fully override return value and abort hook
[
- function( $dummy, $title, $options, &$html, &$attribs, &$ret ) {
+ function ( $dummy, $title, $options, &$html, &$attribs, &$ret ) {
$ret = 'blahblahblah';
return false;
},
@@ -429,6 +433,7 @@ class LinkerTest extends MediaWikiLangTestCase {
* @covers Linker::getLinkColour
*/
public function testGetLinkColour() {
+ $this->hideDeprecated( 'Linker::getLinkColour' );
$linkCache = MediaWikiServices::getInstance()->getLinkCache();
$foobarTitle = Title::makeTitle( NS_MAIN, 'FooBar' );
$redirectTitle = Title::makeTitle( NS_MAIN, 'Redirect' );