$wikiId = 'enwiki'; // $wgConf has a fake entry for this
// @codingStandardsIgnoreStart Generic.Files.LineLength
- return array(
+ return [
// Linker::formatComment
- array(
+ [
'a<script>b',
'a<script>b',
- ),
- array(
+ ],
+ [
'a—b',
'a—b',
- ),
- array(
+ ],
+ [
"'''not bolded'''",
"'''not bolded'''",
- ),
- array(
+ ],
+ [
"try <script>evil</scipt> things",
"try <script>evil</scipt> things",
- ),
+ ],
// Linker::formatAutocomments
- array(
+ [
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
"/* autocomment */",
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#linkie.3F" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment"><a href="/wiki/index.php?title=Linkie%3F&action=edit&redlink=1" class="new" title="Linkie? (page does not exist)">linkie?</a></span></span>',
"/* [[linkie?]] */",
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment: </span> post</span>',
"/* autocomment */ post",
- ),
- array(
+ ],
+ [
'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
"pre /* autocomment */",
- ),
- array(
+ ],
+ [
'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment: </span> post</span>',
"pre /* autocomment */ post",
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment: </span> multiple? <a href="/wiki/Special:BlankPage#autocomment2" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment2: </span> </span></span>',
"/* autocomment */ multiple? /* autocomment2 */ ",
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#autocomment_containing_.2F.2A" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment containing /*: </span> T70361</span>',
"/* autocomment containing /* */ T70361"
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#autocomment_containing_.22quotes.22" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment containing "quotes"</span></span>',
"/* autocomment containing \"quotes\" */"
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#autocomment_containing_.3Cscript.3Etags.3C.2Fscript.3E" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment containing <script>tags</script></span></span>',
"/* autocomment containing <script>tags</script> */"
- ),
- array(
+ ],
+ [
'<a href="#autocomment">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
"/* autocomment */",
false, true
- ),
- array(
+ ],
+ [
'<span dir="auto"><span class="autocomment">autocomment</span></span>',
"/* autocomment */",
null
- ),
- array(
+ ],
+ [
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
"/* autocomment */",
false, false
- ),
- array(
+ ],
+ [
'<a class="external" rel="nofollow" href="//en.example.org/w/Special:BlankPage#autocomment">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
"/* autocomment */",
false, false, $wikiId
- ),
+ ],
// Linker::formatLinksInComment
- array(
+ [
'abc <a href="/wiki/index.php?title=Link&action=edit&redlink=1" class="new" title="Link (page does not exist)">link</a> def',
"abc [[link]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/index.php?title=Link&action=edit&redlink=1" class="new" title="Link (page does not exist)">text</a> def',
"abc [[link|text]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a> def',
"abc [[Special:BlankPage|]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/index.php?title=%C4%84%C5%9B%C5%BC&action=edit&redlink=1" class="new" title="Ąśż (page does not exist)">ąśż</a> def',
"abc [[%C4%85%C5%9B%C5%BC]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/Special:BlankPage#section" title="Special:BlankPage">#section</a> def',
"abc [[#section]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/index.php?title=/subpage&action=edit&redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> def',
"abc [[/subpage]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/index.php?title=%22evil!%22&action=edit&redlink=1" class="new" title=""evil!" (page does not exist)">"evil!"</a> def',
"abc [[\"evil!\"]] def",
- ),
- array(
+ ],
+ [
'abc [[<script>very evil</script>]] def',
"abc [[<script>very evil</script>]] def",
- ),
- array(
+ ],
+ [
'abc [[|]] def',
"abc [[|]] def",
- ),
- array(
+ ],
+ [
'abc <a href="/wiki/index.php?title=Link&action=edit&redlink=1" class="new" title="Link (page does not exist)">link</a> def',
"abc [[link]] def",
false, false
- ),
- array(
+ ],
+ [
'abc <a class="external" rel="nofollow" href="//en.example.org/w/Link">link</a> def',
"abc [[link]] def",
false, false, $wikiId
- )
- );
+ ],
+ ];
// @codingStandardsIgnoreEnd
}
public static function provideCasesForFormatLinksInComment() {
// @codingStandardsIgnoreStart Generic.Files.LineLength
- return array(
- array(
+ return [
+ [
'foo bar <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
'foo bar [[Special:BlankPage]]',
null,
- ),
- array(
+ ],
+ [
'<a class="external" rel="nofollow" href="//en.example.org/w/Foo%27bar">Foo\'bar</a>',
"[[Foo'bar]]",
'enwiki',
- ),
- array(
+ ],
+ [
'foo bar <a class="external" rel="nofollow" href="//en.example.org/w/Special:BlankPage">Special:BlankPage</a>',
'foo bar [[Special:BlankPage]]',
'enwiki',
- ),
- );
+ ],
+ ];
// @codingStandardsIgnoreEnd
}
}