Explicit parameter names for all test fixtures

This is much more readable.  Patch changes nothing.

Bug: T353451
Change-Id: I72b58881a7329dbe98659553b84e53896ccafc2b
This commit is contained in:
Adam Wight 2023-12-21 20:44:39 +01:00
parent e0e8b2dc33
commit 5d1335e279
4 changed files with 169 additions and 171 deletions

View file

@ -224,13 +224,13 @@ class CiteTest extends \MediaWikiIntegrationTestCase {
public static function provideGuardedRef() {
return [
'Whitespace text' => [
' ',
[ 'name' => 'a' ],
null,
[],
'<foot />',
[],
[
'text' => ' ',
'argv' => [ 'name' => 'a' ],
'inReferencesGroup' => null,
'initialRefs' => [],
'expectedOutput' => '<foot />',
'expectedErrors' => [],
'expectedRefs' => [
'' => [
'a' => [
'count' => 0,
@ -244,39 +244,37 @@ class CiteTest extends \MediaWikiIntegrationTestCase {
]
],
'Empty in default references' => [
'',
[],
'',
[ '' => [] ],
'',
'text' => '',
'argv' => [],
'inReferencesGroup' => '',
'initialRefs' => [ '' => [] ],
'expectedOutput' => '',
'expectedErrors' => [ [ 'cite_error_references_no_key' ] ],
[ '' => [] ]
'expectedRefs' => [ '' => [] ]
],
'Fallback to references group' => [
'text',
[ 'name' => 'a' ],
'foo',
[
'foo' => [
'a' => []
]
'text' => 'text',
'argv' => [ 'name' => 'a' ],
'inReferencesGroup' => 'foo',
'initialRefs' => [
'foo' => [ 'a' => [] ],
],
'',
[],
[
'expectedOutput' => '',
'expectedErrors' => [],
'expectedRefs' => [
'foo' => [
'a' => [ 'text' => 'text' ],
],
]
],
'Successful ref' => [
'text',
[ 'name' => 'a' ],
null,
[],
'<foot />',
[],
[
'text' => 'text',
'argv' => [ 'name' => 'a' ],
'inReferencesGroup' => null,
'initialRefs' => [],
'expectedOutput' => '<foot />',
'expectedErrors' => [],
'expectedRefs' => [
'' => [
'a' => [
'count' => 0,
@ -290,29 +288,29 @@ class CiteTest extends \MediaWikiIntegrationTestCase {
]
],
'Invalid ref' => [
'text',
[
'text' => 'text',
'argv' => [
'name' => 'a',
'badkey' => 'b',
],
null,
[],
'(cite_error_ref_too_many_keys)',
[],
[]
'inReferencesGroup' => null,
'initialRefs' => [],
'expectedOutput' => '(cite_error_ref_too_many_keys)',
'expectedErrors' => [],
'expectedRefs' => []
],
'Successful references ref' => [
'text',
[ 'name' => 'a' ],
'',
[
'text' => 'text',
'argv' => [ 'name' => 'a' ],
'inReferencesGroup' => '',
'initialRefs' => [
'' => [
'a' => []
]
],
'',
[],
[
'expectedOutput' => '',
'expectedErrors' => [],
'expectedRefs' => [
'' => [
'a' => [ 'text' => 'text' ],
],
@ -333,17 +331,17 @@ class CiteTest extends \MediaWikiIntegrationTestCase {
'isSectionPreview' => true,
],
'Mismatched text in references' => [
'text-2',
[ 'name' => 'a' ],
'',
[
'text' => 'text-2',
'argv' => [ 'name' => 'a' ],
'inReferencesGroup' => '',
'initialRefs' => [
'' => [
'a' => [ 'text' => 'text-1' ],
]
],
'',
[],
[
'expectedOutput' => '',
'expectedErrors' => [],
'expectedRefs' => [
'' => [
'a' => [
'text' => 'text-1',

View file

@ -44,16 +44,16 @@ class ErrorReporterTest extends \MediaWikiUnitTestCase {
public static function provideErrors() {
return [
'Example error' => [
'cite_error_example',
'<span class="error mw-ext-cite-error" lang="qqx" dir="rtl">' .
'key' => 'cite_error_example',
'expectedHtml' => '<span class="error mw-ext-cite-error" lang="qqx" dir="rtl">' .
'(cite_error|(cite_error_example|first param))</span>',
[ 'cite-tracking-category-cite-error' ]
'categories' => [ 'cite-tracking-category-cite-error' ]
],
'Warning error' => [
'cite_warning_example',
'<span class="warning mw-ext-cite-warning mw-ext-cite-warning-example" lang="qqx" ' .
'key' => 'cite_warning_example',
'expectedHtml' => '<span class="warning mw-ext-cite-warning mw-ext-cite-warning-example" lang="qqx" ' .
'dir="rtl">(cite_warning|(cite_warning_example|first param))</span>',
[]
'categories' => []
],
];
}

View file

@ -52,10 +52,10 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
public static function providePushRef() {
return [
'Anonymous ref in default group' => [
[
'refs' => [
[ 'text', [], '', null, null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => -1,
'dir' => 'rtl',
@ -65,7 +65,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
]
],
[
'finalRefs' => [
'' => [
[
'count' => -1,
@ -77,15 +77,15 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, '', null, null, 'text', [] ],
]
],
'Anonymous ref in named group' => [
[
'refs' => [
[ 'text', [], 'foo', null, null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => -1,
'dir' => 'rtl',
@ -95,7 +95,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
]
],
[
'finalRefs' => [
'foo' => [
[
'count' => -1,
@ -107,15 +107,15 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', null, null, 'text', [] ],
]
],
'Ref with text' => [
[
'refs' => [
[ 'text', [], 'foo', null, null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => -1,
'dir' => 'rtl',
@ -125,7 +125,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
]
],
[
'finalRefs' => [
'foo' => [
[
'count' => -1,
@ -137,15 +137,15 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', null, null, 'text', [] ],
]
],
'Named ref with text' => [
[
'refs' => [
[ 'text', [], 'foo', 'name', null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -155,7 +155,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
],
],
[
'finalRefs' => [
'foo' => [
'name' => [
'count' => 0,
@ -167,16 +167,16 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'name', null, 'text', [] ],
]
],
'Follow after base' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-b', [], 'foo', 'b', null, 'a', 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -187,7 +187,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
],
null
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -199,18 +199,18 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-a', [] ],
]
],
'Follow with no base' => [
[
'refs' => [
[ 'text', [], 'foo', null, null, 'a', 'rtl' ]
],
[
'expectedOutputs' => [
null
],
[
'finalRefs' => [
'foo' => [
[
'count' => -1,
@ -222,17 +222,17 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', null, null, 'text', [] ],
]
],
'Follow pointing to later ref' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-b', [], 'foo', null, null, 'c', 'rtl' ],
[ 'text-c', [], 'foo', 'c', null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -251,7 +251,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 2,
]
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -279,18 +279,18 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-a', [] ],
[ 'new', 2, 'foo', null, null, 'text-b', [] ],
[ 'new', 3, 'foo', 'c', null, 'text-c', [] ],
]
],
'Repeated ref, text in first tag' => [
[
'refs' => [
[ 'text', [], 'foo', 'a', null, null, 'rtl' ],
[ null, [], 'foo', 'a', null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -308,7 +308,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
],
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 1,
@ -320,17 +320,17 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text', [] ],
[ 'increment', 1, 'foo', 'a', null, null, [] ],
]
],
'Repeated ref, text in second tag' => [
[
'refs' => [
[ null, [], 'foo', 'a', null, null, 'rtl' ],
[ 'text', [], 'foo', 'a', null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -348,7 +348,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
]
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 1,
@ -360,17 +360,17 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, null, [] ],
[ 'assign', 1, 'foo', 'a', null, 'text', [] ],
]
],
'Repeated ref, mismatched text' => [
[
'refs' => [
[ 'text-1', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-2', [], 'foo', 'a', null, null, 'rtl' ]
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -389,7 +389,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'warnings' => [ [ 'cite_error_references_duplicate_key', 'a' ] ],
]
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 1,
@ -402,16 +402,16 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-1', [] ],
[ 'increment', 1, 'foo', 'a', null, 'text-2', [] ],
]
],
'Named extends with no parent' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', 'b', null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -423,7 +423,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'extendsIndex' => 1,
],
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -441,16 +441,16 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', 'b', 'text-a', [] ],
]
],
'Named extends before parent' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', 'b', null, 'rtl' ],
[ 'text-b', [], 'foo', 'b', null, null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -470,7 +470,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
]
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -492,17 +492,17 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', 'b', 'text-a', [] ],
[ 'new-from-placeholder', 2, 'foo', 'b', null, 'text-b', [] ],
]
],
'Named extends after parent' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-b', [], 'foo', 'b', 'a', null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -522,7 +522,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'extendsIndex' => 1,
]
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -544,16 +544,16 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-a', [] ],
[ 'new', 2, 'foo', 'b', 'a', 'text-b', [] ],
]
],
'Anonymous extends with no parent' => [
[
'refs' => [
[ 'text-a', [], 'foo', null, 'b', null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => -1,
'dir' => 'rtl',
@ -565,7 +565,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'extendsIndex' => 1,
]
],
[
'finalRefs' => [
'foo' => [
0 => [
'count' => -1,
@ -583,16 +583,16 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
],
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', null, 'b', 'text-a', [] ],
]
],
'Anonymous extends before parent' => [
[
'refs' => [
[ 'text-a', [], 'foo', null, 'b', null, 'rtl' ],
[ 'text-b', [], 'foo', 'b', null, null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => -1,
'dir' => 'rtl',
@ -612,7 +612,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 1,
]
],
[
'finalRefs' => [
'foo' => [
0 => [
'count' => -1,
@ -634,17 +634,17 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', null, 'b', 'text-a', [] ],
[ 'new-from-placeholder', 2, 'foo', 'b', null, 'text-b', [] ],
]
],
'Anonymous extends after parent' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-b', [], 'foo', null, 'a', null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -664,7 +664,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'extendsIndex' => 1,
]
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -686,18 +686,18 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
]
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-a', [] ],
[ 'new', 2, 'foo', null, 'a', 'text-b', [] ],
]
],
'Normal after extends' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-b', [], 'foo', null, 'a', null, 'rtl' ],
[ 'text-c', [], 'foo', 'c', null, null, 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -725,7 +725,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
'number' => 2,
],
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -755,19 +755,19 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
],
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-a', [] ],
[ 'new', 2, 'foo', null, 'a', 'text-b', [] ],
[ 'new', 3, 'foo', 'c', null, 'text-c', [] ],
]
],
'Two incomplete follows' => [
[
'refs' => [
[ 'text-a', [], 'foo', 'a', null, null, 'rtl' ],
[ 'text-b', [], 'foo', null, null, 'd', 'rtl' ],
[ 'text-c', [], 'foo', null, null, 'd', 'rtl' ],
],
[
'expectedOutputs' => [
[
'count' => 0,
'dir' => 'rtl',
@ -779,7 +779,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
null,
null
],
[
'finalRefs' => [
'foo' => [
'a' => [
'count' => 0,
@ -807,7 +807,7 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
],
]
],
[
'finalCallStack' => [
[ 'new', 1, 'foo', 'a', null, 'text-a', [] ],
[ 'new', 2, 'foo', null, null, 'text-b', [] ],
[ 'new', 3, 'foo', null, null, 'text-c', [] ],

View file

@ -50,22 +50,22 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
public static function provideFormatReferences() {
return [
'Empty' => [
[],
''
'refs' => [],
'expectedOutput' => ''
],
'Minimal ref' => [
[
'refs' => [
0 => [
'key' => 1,
'text' => 't',
]
],
'<div class="mw-references-wrap"><ol class="references">' . "\n" .
'expectedOutput' => '<div class="mw-references-wrap"><ol class="references">' . "\n" .
'<li>(cite_references_link_many|||<span class="reference-text">t</span>' .
"\n|)</li>\n</ol></div>"
],
'Ref with extends' => [
[
'refs' => [
0 => [
'extends' => 'a',
'extendsIndex' => 1,
@ -83,7 +83,7 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
'text' => 't1',
],
],
'<div class="mw-references-wrap"><ol class="references">' . "\n" .
'expectedOutput' => '<div class="mw-references-wrap"><ol class="references">' . "\n" .
'<li>(cite_references_link_many|||<span class="reference-text">t1</span>' . "\n" .
'|)<ol class="mw-extended-references"><li>(cite_references_link_many|||' .
'<span class="reference-text">t2</span>' . "\n|)</li>\n" .
@ -93,7 +93,7 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
'</ol></div>'
],
'Subref of subref' => [
[
'refs' => [
0 => [
'extends' => 'a',
'extendsIndex' => 1,
@ -114,7 +114,7 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
'text' => 't3',
],
],
'<div class="mw-references-wrap"><ol class="references">' . "\n" .
'expectedOutput' => '<div class="mw-references-wrap"><ol class="references">' . "\n" .
'<li>(cite_references_link_many|||<span class="reference-text">t3</span>' . "\n" .
'|)<ol class="mw-extended-references"><li>(cite_references_link_many|||' .
'<span class="reference-text">t1 (cite_error_ref_nested_extends|a|b)</span>' .
@ -124,11 +124,11 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
'</ol></div>'
],
'Use columns' => [
array_map(
'refs' => array_map(
static fn ( $i ) => [ 'key' => $i, 'text' => 't' ],
range( 0, 10 )
),
'<div class="mw-references-wrap mw-references-columns"><ol class="references">' .
'expectedOutput' => '<div class="mw-references-wrap mw-references-columns"><ol class="references">' .
"\n" . '<li>(cite_references_link_many|||<span class="reference-text">t</span>' .
"\n|)</li>\n" .
'<li>(cite_references_link_many|||<span class="reference-text">t</span>' .
@ -222,51 +222,51 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
public static function provideFormatListItem() {
return [
'Success' => [
[
'ref' => [
'text' => 't',
],
'(cite_references_link_many|1-||<span class="reference-text">t</span>' . "\n|)"
'expectedOutput' => '(cite_references_link_many|1-||<span class="reference-text">t</span>' . "\n|)"
],
'With dir' => [
[
'ref' => [
'dir' => 'rtl',
'text' => 't',
],
'(cite_references_link_many|1-||<span class="reference-text">t</span>' .
'expectedOutput' => '(cite_references_link_many|1-||<span class="reference-text">t</span>' .
"\n" . '| class="mw-cite-dir-rtl")'
],
'Incomplete follow' => [
[
'ref' => [
'follow' => 'f',
'text' => 't',
],
"<p id=\"f\"><span class=\"reference-text\">t</span>\n</p>"
'expectedOutput' => "<p id=\"f\"><span class=\"reference-text\">t</span>\n</p>"
],
'Count zero' => [
[
'ref' => [
'count' => 0,
'key' => 5,
'text' => 't',
],
'(cite_references_link_one|1-5|1+5-0|<span class="reference-text">t</span>' . "\n|)"
'expectedOutput' => '(cite_references_link_one|1-5|1+5-0|<span class="reference-text">t</span>' . "\n|)"
],
'Count negative' => [
[
'ref' => [
'count' => -1,
'key' => 5,
'number' => 3,
'text' => 't',
],
'(cite_references_link_one|5|5+|<span class="reference-text">t</span>' . "\n|)"
'expectedOutput' => '(cite_references_link_one|5|5+|<span class="reference-text">t</span>' . "\n|)"
],
'Count positive' => [
[
'ref' => [
'count' => 2,
'key' => 5,
'number' => 3,
'text' => 't',
],
'(cite_references_link_many|1-5|(cite_references_link_many_format|1+5-0|3.0|' .
'expectedOutput' => '(cite_references_link_many|1-5|(cite_references_link_many_format|1+5-0|3.0|' .
'(cite_references_link_many_format_backlink_labels))' .
'(cite_references_link_many_sep)(cite_references_link_many_format|1+5-1|3.1|' .
'(cite_error_references_no_backlink_label))(cite_references_link_many_and)' .
@ -304,24 +304,24 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
public static function provideReferenceText() {
return [
'No text, not preview' => [
null,
false,
'(cite_error_references_no_text|1)'
'text' => null,
'isSectionPreview' => false,
'expectedOutput' => '(cite_error_references_no_text|1)'
],
'No text, is preview' => [
null,
true,
'(cite_warning_sectionpreview_no_text|1)'
'text' => null,
'isSectionPreview' => true,
'expectedOutput' => '(cite_warning_sectionpreview_no_text|1)'
],
'Has text' => [
'text',
true,
'<span class="reference-text">text</span>' . "\n"
'text' => 'text',
'isSectionPreview' => true,
'expectedOutput' => '<span class="reference-text">text</span>' . "\n"
],
'Trims text' => [
"text\n\n",
true,
'<span class="reference-text">text</span>' . "\n"
'text' => "text\n\n",
'isSectionPreview' => true,
'expectedOutput' => '<span class="reference-text">text</span>' . "\n"
],
];
}
@ -419,21 +419,21 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
public static function provideLists() {
return [
[
[],
''
'list' => [],
'expected' => ''
],
[
// This is intentionally using numbers to test the to-string cast
[ 1 ],
'1'
'list' => [ 1 ],
'expected' => '1'
],
[
[ 1, 2 ],
'1(cite_references_link_many_and)2'
'list' => [ 1, 2 ],
'expected' => '1(cite_references_link_many_and)2'
],
[
[ 1, 2, 3 ],
'1(cite_references_link_many_sep)2(cite_references_link_many_and)3'
'list' => [ 1, 2, 3 ],
'expected' => '1(cite_references_link_many_sep)2(cite_references_link_many_and)3'
],
];
}