mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-14 10:34:53 +00:00
More explicit test fixtures: key and count
These fields get automatic values during normal operation, but we should make this explicit in tests which meddle with internals. This seems to add some clarity, and helps prepare for encapsulation. Bug: T353451 Change-Id: I8b012a270f16139671f77ea04645d627b2fba87d
This commit is contained in:
parent
76e6e870d4
commit
ca6414320f
|
@ -945,16 +945,18 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
|
|||
],
|
||||
'Safely ignore placeholder' => [
|
||||
'initialCallStack' => [
|
||||
[ 'increment', 1, 'foo', null, null, null, [] ],
|
||||
[ 'increment', 2, 'foo', null, null, null, [] ],
|
||||
],
|
||||
'initialRefs' => [ 'foo' => [
|
||||
[
|
||||
'count' => -1,
|
||||
'key' => 1,
|
||||
'placeholder' => true,
|
||||
'number' => 10,
|
||||
],
|
||||
[
|
||||
'count' => 2,
|
||||
'key' => 1,
|
||||
'key' => 2,
|
||||
],
|
||||
] ],
|
||||
'rollbackCount' => 1,
|
||||
|
@ -963,12 +965,14 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase {
|
|||
],
|
||||
'expectedRefs' => [ 'foo' => [
|
||||
[
|
||||
'count' => -1,
|
||||
'key' => 1,
|
||||
'placeholder' => true,
|
||||
'number' => 10,
|
||||
],
|
||||
[
|
||||
'count' => 1,
|
||||
'key' => 1,
|
||||
'key' => 2,
|
||||
],
|
||||
] ],
|
||||
],
|
||||
|
|
|
@ -84,6 +84,7 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
|
|||
'a' => [
|
||||
'count' => 0,
|
||||
'key' => 1,
|
||||
'name' => 'a',
|
||||
'number' => 9,
|
||||
'text' => 't1',
|
||||
],
|
||||
|
@ -112,12 +113,14 @@ class ReferencesFormatterTest extends \MediaWikiUnitTestCase {
|
|||
'extends' => 'b',
|
||||
'extendsIndex' => 1,
|
||||
'key' => 2,
|
||||
'name' => 'a',
|
||||
'number' => 1,
|
||||
'text' => 't2',
|
||||
],
|
||||
'b' => [
|
||||
'count' => 0,
|
||||
'key' => 3,
|
||||
'name' => 'b',
|
||||
'number' => 1,
|
||||
'text' => 't3',
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue