aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension/style_path_provider_test.php
blob: f2ee957f4c7b7ccc34425156bc665e85ea3d3915 (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
<?php
/**
*
* @package testing
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';

class phpbb_extension_style_path_provider_test extends phpbb_test_case
{
	protected $relative_root_path;
	protected $root_path;

	public function setUp()
	{
		$this->relative_root_path = './';
		$this->root_path = dirname(__FILE__) . '/';
	}

	public function test_find()
	{
		$phpbb_style_path_provider = new \phpbb\style\path_provider();
		$phpbb_style_path_provider->set_styles(array($this->relative_root_path . 'styles/prosilver'));
		$phpbb_style_extension_path_provider = new \phpbb\style\extension_path_provider(new phpbb_mock_extension_manager(
			$this->root_path,
			array(
				'foo' => array(
					'ext_name' => 'foo',
					'ext_active' => '1',
					'ext_path' => 'ext/foo/',
				),
				'bar' => array(
					'ext_name' => 'bar',
					'ext_active' => '1',
					'ext_path' => 'ext/bar/',
				),
			)), $phpbb_style_path_provider, $this->relative_root_path);

		$this->assertEquals(array(
			'style' => array(
				$this->relative_root_path . 'styles/prosilver',
			),
			'bar' => array(
				$this->root_path . 'ext/bar/styles/prosilver',
			),
		), $phpbb_style_extension_path_provider->find());
	}
}