mediawiki-extensions-Relate.../tests/phpunit/HooksTest.php
jhobs d08962d12d [Hygiene] Rename internal uses of "article" to "page"
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
2015-11-13 19:03:39 -05:00

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.'
);
}
}