mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
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
This commit is contained in:
@@ -0,0 +1 @@
|
||||
bertie rules!
|
@@ -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);
|
||||
|
50
tests/extension/style_path_provider_test.php
Normal file
50
tests/extension/style_path_provider_test.php
Normal file
@@ -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());
|
||||
}
|
||||
}
|
18
tests/extension/subdir/style_path_provider_test.php
Normal file
18
tests/extension/subdir/style_path_provider_test.php
Normal file
@@ -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__) . '/../';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user