summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Factbox/FactboxFactoryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Factbox/FactboxFactoryTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Factbox/FactboxFactoryTest.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Factbox/FactboxFactoryTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Factbox/FactboxFactoryTest.php
new file mode 100644
index 00000000..b4fe99ce
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Factbox/FactboxFactoryTest.php
@@ -0,0 +1,59 @@
+<?php
+
+namespace SMW\Tests\Factbox;
+
+use SMW\Factbox\FactboxFactory;
+use Title;
+
+/**
+ * @covers \SMW\Factbox\FactboxFactory
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 2.0
+ *
+ * @author mwjames
+ */
+class FactboxFactoryTest extends \PHPUnit_Framework_TestCase {
+
+ public function testCanConstruct() {
+
+ $this->assertInstanceOf(
+ '\SMW\Factbox\FactboxFactory',
+ new FactboxFactory()
+ );
+ }
+
+ public function testCanConstructCachedFactbox() {
+
+ $instance = new FactboxFactory();
+
+ $this->assertInstanceOf(
+ '\SMW\Factbox\CachedFactbox',
+ $instance->newCachedFactbox()
+ );
+ }
+
+ public function testCanConstructFactbox() {
+
+ $title = $this->getMockBuilder( '\Title' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $title->expects( $this->any() )
+ ->method( 'getNamespace' )
+ ->will( $this->returnValue( NS_MAIN ) );
+
+ $parserOutput = $this->getMockBuilder( '\ParserOutput' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $instance = new FactboxFactory();
+
+ $this->assertInstanceOf(
+ '\SMW\Factbox\Factbox',
+ $instance->newFactbox( $title, $parserOutput )
+ );
+ }
+
+}