summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/DeferredTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/DeferredTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/DeferredTest.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/DeferredTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/DeferredTest.php
new file mode 100644
index 00000000..73ee4df8
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/DeferredTest.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace SMW\Tests\Query;
+
+use SMW\Query\Deferred;
+
+/**
+ * @covers \SMW\Query\Deferred
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 3.0
+ *
+ * @author mwjames
+ */
+class DeferredTest extends \PHPUnit_Framework_TestCase {
+
+ public function testRegisterResourceModules() {
+
+ $parserOutput = $this->getMockBuilder( '\ParserOutput' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $parserOutput->expects( $this->once() )
+ ->method( 'addModuleStyles' );
+
+ $parserOutput->expects( $this->once() )
+ ->method( 'addModules' );
+
+ Deferred::registerResources( $parserOutput );
+ }
+
+ public function testBuildHTML() {
+
+ $query = $this->getMockBuilder( '\SMWQuery' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->assertContains(
+ 'smw-deferred-query',
+ Deferred::buildHTML( $query )
+ );
+ }
+
+}