| 1 |
<?php |
| 2 |
|
| 3 |
namespace Cite\Tests; |
| 4 |
|
| 5 |
use MediaWiki\Parser\ParserOptions; |
| 6 |
use MediaWiki\Title\Title; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
class CiteDbTest extends \MediaWikiIntegrationTestCase { |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
public function testReferenceStackError() { |
| 19 |
$this->insertPage( 'Cite-tracking-category-cite-error', '{{PAGENAME}}', NS_MEDIAWIKI ); |
| 20 |
|
| 21 |
$services = $this->getServiceContainer(); |
| 22 |
|
| 23 |
$services->resetServiceForTesting( 'MessageCache' ); |
| 24 |
$services->getMessageCache()->enable(); |
| 25 |
|
| 26 |
$parserOutput = $services->getParser()->parse( |
| 27 |
' |
| 28 |
<ref name="a">text #1</ref> |
| 29 |
<ref name="a">text #2</ref> |
| 30 |
<ref>text #3</ref> |
| 31 |
', |
| 32 |
Title::makeTitle( NS_MAIN, mt_rand() ), |
| 33 |
ParserOptions::newFromAnon() |
| 34 |
); |
| 35 |
|
| 36 |
$this->assertStringContainsString( |
| 37 |
'cite_ref-2', |
| 38 |
$parserOutput->getText(), |
| 39 |
'Internal counter should not reset to 1 for text #3' |
| 40 |
); |
| 41 |
} |
| 42 |
|
| 43 |
} |