mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-18 11:00:58 +00:00
d08962d12d
Leave all public-facing uses of "article" (including classes) because the extension is remaining named RelatedArticles. Replace all other instances with "page" for consistency with other extensions. Bug: T117908 Change-Id: Ib0f258f26b0d11cfe8a598dbd90ff37afbbe36ac
35 lines
851 B
PHP
35 lines
851 B
PHP
<?php
|
|
|
|
namespace Tests\RelatedArticles;
|
|
|
|
use PHPUnit_Framework_TestCase;
|
|
use Parser;
|
|
use ParserOutput;
|
|
use RelatedArticles\Hooks;
|
|
|
|
class HooksTest extends PHPUnit_Framework_TestCase {
|
|
|
|
public function test_onParserClearState() {
|
|
$parser = new Parser();
|
|
$parserOutput = $parser->mOutput = new ParserOutput();
|
|
$relatedPages = array( 'Maybeshewill' );
|
|
|
|
$parserOutput->setExtensionData( 'RelatedArticles', $relatedPages );
|
|
$parserOutput->setProperty( 'RelatedArticles', $relatedPages );
|
|
|
|
Hooks::onParserClearState( $parser );
|
|
|
|
$this->assertEquals(
|
|
array(),
|
|
$parserOutput->getExtensionData( 'RelatedArticles' ),
|
|
'It clears the list of related pages.'
|
|
);
|
|
|
|
$this->assertEquals(
|
|
false,
|
|
$parserOutput->getProperty( 'RelatedArticles' ),
|
|
'[T115698] It unsets the list of related pages that were set as a property.'
|
|
);
|
|
}
|
|
}
|