summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php
new file mode 100644
index 00000000..def0c4c5
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace SMW\Tests;
+
+use SMW\DIWikiPage;
+
+/**
+ * @covers \SMW\Store
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 2.4
+ *
+ * @author mwjames
+ */
+class StoreTest extends \PHPUnit_Framework_TestCase {
+
+ public function testGetRedirectTarget() {
+
+ $wikipage = new DIWikiPage( 'Foo', NS_MAIN );
+ $expected = new DIWikiPage( 'Bar', NS_MAIN );
+
+ $instance = $this->getMockBuilder( '\SMW\Store' )
+ ->disableOriginalConstructor()
+ ->setMethods( [ 'getPropertyValues' ] )
+ ->getMockForAbstractClass();
+
+ $instance->expects( $this->once() )
+ ->method( 'getPropertyValues' )
+ ->will( $this->returnValue( [ $expected ] ) );
+
+ $this->assertEquals(
+ $expected,
+ $instance->getRedirectTarget( $wikipage )
+ );
+ }
+
+}