summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/ResourceLoaderTestModulesTest.php
blob: dea78b7951c3e1f2f61d0bbb5459edab70d71622 (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
<?php

namespace SMW\Tests\MediaWiki\Hooks;

use SMW\MediaWiki\Hooks\ResourceLoaderTestModules;

/**
 * @covers \SMW\MediaWiki\Hooks\ResourceLoaderTestModules
 * @group semantic-mediawiki
 *
 * @license GNU GPL v2+
 * @since 2.0
 *
 * @author mwjames
 */
class ResourceLoaderTestModulesTest extends \PHPUnit_Framework_TestCase {

	public function testCanConstruct() {

		$resourceLoader = $this->getMockBuilder( '\ResourceLoader' )
			->disableOriginalConstructor()
			->getMock();

		$this->assertInstanceOf(
			ResourceLoaderTestModules::class,
			new ResourceLoaderTestModules( $resourceLoader )
		);
	}

	public function testProcess() {

		$resourceLoader = $this->getMockBuilder( '\ResourceLoader' )
			->disableOriginalConstructor()
			->getMock();

		$testModules = [];

		$instance = new ResourceLoaderTestModules( $resourceLoader );
		$instance->process( $testModules );

		$this->assertArrayHasKey(
			'ext.smw.tests',
			$testModules['qunit']
		);

		$this->assertArrayHasKey(
			'localBasePath',
			$testModules['qunit']['ext.smw.tests']
		);

		$this->assertArrayHasKey(
			'remoteExtPath',
			$testModules['qunit']['ext.smw.tests']
		);
	}

}