summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php
new file mode 100644
index 00000000..968b0d61
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace SMW\Tests\Importer;
+
+use SMW\Importer\ContentModeller;
+use SMW\Tests\TestEnvironment;
+
+/**
+ * @covers \SMW\Importer\ContentModeller
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 3.0
+ *
+ * @author mwjames
+ */
+class ContentModellerTest extends \PHPUnit_Framework_TestCase {
+
+ private $contentModeller;
+ private $testEnvironment;
+ private $fixtures;
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->contentModeller = new ContentModeller();
+
+ $this->testEnvironment = new TestEnvironment();
+ $this->fixtures = __DIR__ . '/Fixtures';
+ }
+
+ public function testCanConstruct() {
+
+ $this->assertInstanceOf(
+ ContentModeller::class,
+ new ContentModeller()
+ );
+ }
+
+ public function testMakeContentList() {
+
+ $contents = [
+ 'description' => '...',
+ 'import' => [
+ 'page' => 'Foo',
+ 'version' => 1
+ ]
+ ];
+
+ $instance = new ContentModeller();
+
+ $contents = $instance->makeContentList( 'Foo', $contents );
+
+ foreach ( $contents as $content ) {
+ $this->assertInstanceOf(
+ '\SMW\Importer\ImportContents',
+ $content
+ );
+ }
+ }
+
+}