diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/ParserAfterTidyIntegrationTest.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/ParserAfterTidyIntegrationTest.php | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/ParserAfterTidyIntegrationTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/ParserAfterTidyIntegrationTest.php new file mode 100644 index 00000000..d9810415 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/ParserAfterTidyIntegrationTest.php @@ -0,0 +1,59 @@ +<?php + +namespace SMW\Tests\Integration\MediaWiki\Hooks; + +use SMW\ApplicationFactory; +use SMW\Tests\Utils\UtilityFactory; +use Title; + +/** + * @group semantic-mediawiki + * @group medium + * + * @license GNU GPL v2+ + * @since 2.1 + * + * @author mwjames + */ +class ParserAfterTidyIntegrationTest extends \PHPUnit_Framework_TestCase { + + private $mwHooksHandler; + private $parserAfterTidyHook; + private $applicationFactory; + + protected function setUp() { + parent::setUp(); + + $this->applicationFactory = ApplicationFactory::getInstance(); + + $this->mwHooksHandler = UtilityFactory::getInstance()->newMwHooksHandler(); + $this->mwHooksHandler->deregisterListedHooks(); + + $this->mwHooksHandler->register( + 'ParserAfterTidy', + $this->mwHooksHandler->getHookRegistry()->getHandlerFor( 'ParserAfterTidy' ) + ); + } + + protected function tearDown() { + $this->mwHooksHandler->restoreListedHooks(); + $this->applicationFactory->clear(); + + parent::tearDown(); + } + + public function testNonParseForInvokedMessageParse() { + + $parserData = $this->getMockBuilder( '\SMW\ParserData' ) + ->disableOriginalConstructor() + ->getMock(); + + $parserData->expects( $this->never() ) + ->method( 'getSemanticData' ); + + $this->applicationFactory->registerObject( 'ParserData', $parserData ); + + wfMessage( 'properties' )->parse(); + } + +} |