summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/SPARQLStoreFactoryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/SPARQLStoreFactoryTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/SPARQLStoreFactoryTest.php94
1 files changed, 94 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/SPARQLStoreFactoryTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/SPARQLStoreFactoryTest.php
new file mode 100644
index 00000000..3253cd01
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/SPARQLStoreFactoryTest.php
@@ -0,0 +1,94 @@
+<?php
+
+namespace SMW\Tests\SPARQLStore;
+
+use SMW\SPARQLStore\SPARQLStoreFactory;
+
+/**
+ * @covers \SMW\SPARQLStore\SPARQLStoreFactory
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 2.2
+ *
+ * @author mwjames
+ */
+class SPARQLStoreFactoryTest extends \PHPUnit_Framework_TestCase {
+
+ private $store;
+
+ protected function setUp() {
+ parent::setUp();
+
+ $repositoryConnection = $this->getMockBuilder( '\SMW\SPARQLStore\RepositoryConnection' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->store = $this->getMockBuilder( '\SMW\SPARQLStore\SPARQLStore' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->store->expects( $this->any() )
+ ->method( 'getConnection' )
+ ->will( $this->returnValue( $repositoryConnection ) );
+ }
+
+ public function testCanConstruct() {
+
+ $this->assertInstanceOf(
+ '\SMW\SPARQLStore\SPARQLStoreFactory',
+ new SPARQLStoreFactory( $this->store )
+ );
+ }
+
+ public function testCanConstructBaseStore() {
+
+ $instance = new SPARQLStoreFactory( $this->store );
+
+ $this->assertInstanceOf(
+ '\SMWSQLStore3',
+ $instance->getBaseStore( 'SMWSQLStore3' )
+ );
+ }
+
+ public function testCanConstructMasterQueryEngine() {
+
+ $instance = new SPARQLStoreFactory( $this->store );
+
+ $this->assertInstanceOf(
+ '\SMW\QueryEngine',
+ $instance->newMasterQueryEngine()
+ );
+ }
+
+ public function testCanConstructConnectionManager() {
+
+ $instance = new SPARQLStoreFactory( $this->store );
+
+ $this->assertInstanceOf(
+ '\SMW\Connection\ConnectionManager',
+ $instance->getConnectionManager()
+ );
+ }
+
+ public function testCanConstructRepositoryRedirectLookup() {
+
+ $instance = new SPARQLStoreFactory( $this->store );
+
+ $this->assertInstanceOf(
+ '\SMW\SPARQLStore\RepositoryRedirectLookup',
+ $instance->newRepositoryRedirectLookup()
+ );
+ }
+
+ public function testCanConstructReplicationDataTruncator() {
+
+ $instance = new SPARQLStoreFactory( $this->store );
+
+ $this->assertInstanceOf(
+ '\SMW\SPARQLStore\ReplicationDataTruncator',
+ $instance->newReplicationDataTruncator()
+ );
+ }
+
+}