summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Importer/ContentModellerTest.php
blob: 968b0d618699d25705c2b61335e1fdda87a3743c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
			);
		}
	}

}