diff options
author | Nils Adermann <naderman@naderman.de> | 2013-04-24 09:52:57 -0700 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2013-04-24 09:52:57 -0700 |
commit | 81daf21dc08a18de4a9e541b067724f37ba4d481 (patch) | |
tree | d3ed7ee714c0d6629dd78ff01cdfc13ee66986d7 /tests/extension | |
parent | 3e32655c7f22ce9aff7bafdbab6d556879b5fcf9 (diff) | |
parent | 10781ce9ae74efd4f04063c78235f4be031b414a (diff) | |
download | forums-81daf21dc08a18de4a9e541b067724f37ba4d481.tar forums-81daf21dc08a18de4a9e541b067724f37ba4d481.tar.gz forums-81daf21dc08a18de4a9e541b067724f37ba4d481.tar.bz2 forums-81daf21dc08a18de4a9e541b067724f37ba4d481.tar.xz forums-81daf21dc08a18de4a9e541b067724f37ba4d481.zip |
Merge pull request #1324 from nickvergessen/ticket/10844-2
Ticket/10844 Extensions are not located when front-end file has a diffferent phpbb_root_path
Diffstat (limited to 'tests/extension')
-rw-r--r-- | tests/extension/ext/bar/styles/prosilver/template/foobar_body.html | 1 | ||||
-rw-r--r-- | tests/extension/finder_test.php | 2 | ||||
-rw-r--r-- | tests/extension/style_path_provider_test.php | 50 | ||||
-rw-r--r-- | tests/extension/subdir/style_path_provider_test.php | 18 |
4 files changed, 70 insertions, 1 deletions
diff --git a/tests/extension/ext/bar/styles/prosilver/template/foobar_body.html b/tests/extension/ext/bar/styles/prosilver/template/foobar_body.html new file mode 100644 index 0000000000..00c2a84a18 --- /dev/null +++ b/tests/extension/ext/bar/styles/prosilver/template/foobar_body.html @@ -0,0 +1 @@ +bertie rules! diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php index 73c07ef79a..4c99ba6343 100644 --- a/tests/extension/finder_test.php +++ b/tests/extension/finder_test.php @@ -67,7 +67,7 @@ class phpbb_extension_finder_test extends phpbb_test_case public function test_prefix_get_directories() { $dirs = $this->finder - ->prefix('t') + ->prefix('ty') ->get_directories(); sort($dirs); diff --git a/tests/extension/style_path_provider_test.php b/tests/extension/style_path_provider_test.php new file mode 100644 index 0000000000..e1021c20ac --- /dev/null +++ b/tests/extension/style_path_provider_test.php @@ -0,0 +1,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()); + } +} diff --git a/tests/extension/subdir/style_path_provider_test.php b/tests/extension/subdir/style_path_provider_test.php new file mode 100644 index 0000000000..1b5ce62e5f --- /dev/null +++ b/tests/extension/subdir/style_path_provider_test.php @@ -0,0 +1,18 @@ +<?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__) . '/../style_path_provider_test.php'; + +class phpbb_extension_subdir_style_path_provider_test extends phpbb_extension_style_path_provider_test +{ + public function setUp() + { + $this->relative_root_path = '../'; + $this->root_path = dirname(__FILE__) . '/../'; + } +} |