X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Finstaller%2FInstallDocFormatterTest.php;h=9584d4b8c451e57bedf6e70ac9a4a0c8904b5549;hb=d84c3dde5af90c5c3497d18e427a5c2a38ac6ca8;hp=724f0c885fcb01813c8690e31f6af6c75b57e80d;hpb=6b1a173f07f1a04188735f4688ce6335da14c3b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php index 724f0c885f..9584d4b8c4 100644 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php @@ -1,12 +1,8 @@ ', 'Install ', 'Escaping <' ), - array( 'Install {{template}}', 'Install {{template}}', 'Escaping [[' ), - array( 'Install [[page]]', 'Install [[page]]', 'Escaping {{' ), - array( 'Install __TOC__', 'Install __TOC__', 'Escaping __' ), - array( 'Install ', "Install \r", 'Removing \r' ), + [ 'Install <tag>', 'Install ', 'Escaping <' ], + [ 'Install {{template}}', 'Install {{template}}', 'Escaping [[' ], + [ 'Install [[page]]', 'Install [[page]]', 'Escaping {{' ], + [ 'Install __TOC__', 'Install __TOC__', 'Escaping __' ], + [ 'Install ', "Install \r", 'Removing \r' ], # Transform \t{1,2} into :{1,2} - array( ':One indentation', "\tOne indentation", 'Replacing a single \t' ), - array( '::Two indentations', "\t\tTwo indentations", 'Replacing 2 x \t' ), + [ ':One indentation', "\tOne indentation", 'Replacing a single \t' ], + [ '::Two indentations', "\t\tTwo indentations", 'Replacing 2 x \t' ], # Transform 'T123' links - array( + [ '[https://phabricator.wikimedia.org/T123 T123]', - 'T123', 'Testing T123 links' ), - array( + 'T123', 'Testing T123 links' ], + [ 'bug [https://phabricator.wikimedia.org/T123 T123]', - 'bug T123', 'Testing bug T123 links' ), - array( + 'bug T123', 'Testing bug T123 links' ], + [ '([https://phabricator.wikimedia.org/T987654 T987654])', - '(T987654)', 'Testing (T987654) links' ), + '(T987654)', 'Testing (T987654) links' ], # "Tabc" shouldn't work - array( 'Tfoobar', 'Tfoobar', "Don't match T followed by non-digits" ), - array( 'T!!fakefake!!', 'T!!fakefake!!', "Don't match T followed by non-digits" ), + [ 'Tfoobar', 'Tfoobar', "Don't match T followed by non-digits" ], + [ 'T!!fakefake!!', 'T!!fakefake!!', "Don't match T followed by non-digits" ], # Transform 'bug 123' links - array( + [ '[https://bugzilla.wikimedia.org/123 bug 123]', - 'bug 123', 'Testing bug 123 links' ), - array( + 'bug 123', 'Testing bug 123 links' ], + [ '([https://bugzilla.wikimedia.org/987654 bug 987654])', - '(bug 987654)', 'Testing (bug 987654) links' ), + '(bug 987654)', 'Testing (bug 987654) links' ], # "bug abc" shouldn't work - array( 'bug foobar', 'bug foobar', "Don't match bug followed by non-digits" ), - array( 'bug !!fakefake!!', 'bug !!fakefake!!', "Don't match bug followed by non-digits" ), + [ 'bug foobar', 'bug foobar', "Don't match bug followed by non-digits" ], + [ 'bug !!fakefake!!', 'bug !!fakefake!!', "Don't match bug followed by non-digits" ], # Transform '$wgFooBar' links - array( + [ '' . '[https://www.mediawiki.org/wiki/Manual:$wgFooBar $wgFooBar]', - '$wgFooBar', 'Testing basic $wgFooBar' ), - array( + '$wgFooBar', 'Testing basic $wgFooBar' ], + [ '' . '[https://www.mediawiki.org/wiki/Manual:$wgFooBar45 $wgFooBar45]', - '$wgFooBar45', 'Testing $wgFooBar45 (with numbers)' ), - array( + '$wgFooBar45', 'Testing $wgFooBar45 (with numbers)' ], + [ '' . '[https://www.mediawiki.org/wiki/Manual:$wgFoo_Bar $wgFoo_Bar]', - '$wgFoo_Bar', 'Testing $wgFoo_Bar (with underscore)' ), + '$wgFoo_Bar', 'Testing $wgFoo_Bar (with underscore)' ], # Icky variables that shouldn't link - array( + [ '$myAwesomeVariable', '$myAwesomeVariable', 'Testing $myAwesomeVariable (not starting with $wg)' - ), - array( '$()not!a&Var', '$()not!a&Var', 'Testing $()not!a&Var (obviously not a variable)' ), - ); + ], + [ '$()not!a&Var', '$()not!a&Var', 'Testing $()not!a&Var (obviously not a variable)' ], + ]; } }