diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/InternalParseBeforeLinksIntegrationTest.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/InternalParseBeforeLinksIntegrationTest.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/InternalParseBeforeLinksIntegrationTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/InternalParseBeforeLinksIntegrationTest.php new file mode 100644 index 00000000..402a1230 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Hooks/InternalParseBeforeLinksIntegrationTest.php @@ -0,0 +1,62 @@ +<?php + +namespace SMW\Tests\Integration\MediaWiki\Hooks; + +use SMW\ApplicationFactory; +use SMW\Tests\Utils\UtilityFactory; +use Title; + +/** + * @group SMW + * @group SMWExtension + * @group semantic-mediawiki-integration + * @group mediawiki-databaseless + * @group medium + * + * @license GNU GPL v2+ + * @since 2.1 + * + * @author mwjames + */ +class InternalParseBeforeLinksIntegrationTest 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( + 'InternalParseBeforeLinks', + $this->mwHooksHandler->getHookRegistry()->getHandlerFor( 'InternalParseBeforeLinks' ) + ); + } + + 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(); + } + +} |