aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/common.php2
-rw-r--r--phpBB/config/services.yml2
-rw-r--r--phpBB/download/file.php4
-rw-r--r--phpBB/includes/acp/acp_modules.php2
-rw-r--r--phpBB/install/index.php2
-rw-r--r--phpBB/phpbb/extension/finder.php13
-rw-r--r--phpBB/phpbb/extension/manager.php2
-rw-r--r--tests/class_loader/class_loader_test.php4
-rw-r--r--tests/extension/ext/bar/ext.php4
-rw-r--r--tests/extension/ext/barfoo/acp/a_info.php6
-rw-r--r--tests/extension/ext/barfoo/acp/a_module.php4
-rw-r--r--tests/extension/ext/barfoo/ext.php4
-rw-r--r--tests/extension/ext/foo/a_class.php4
-rw-r--r--tests/extension/ext/foo/acp/a_info.php6
-rw-r--r--tests/extension/ext/foo/acp/a_module.php4
-rw-r--r--tests/extension/ext/foo/acp/fail_info.php5
-rw-r--r--tests/extension/ext/foo/acp/fail_module.php5
-rw-r--r--tests/extension/ext/foo/b_class.php4
-rw-r--r--tests/extension/ext/foo/ext.php4
-rw-r--r--tests/extension/ext/foo/mcp/a_info.php6
-rw-r--r--tests/extension/ext/foo/mcp/a_module.php4
-rw-r--r--tests/extension/ext/foo/sub/type/alternative.php4
-rw-r--r--tests/extension/ext/foo/type/alternative.php4
-rw-r--r--tests/extension/ext/foo/typewrong/error.php4
-rw-r--r--tests/extension/ext/vendor/moo/ext.php4
-rw-r--r--tests/extension/ext/vendor/moo/feature_class.php4
-rw-r--r--tests/extension/finder_test.php22
-rw-r--r--tests/extension/manager_test.php12
-rw-r--r--tests/extension/modules_test.php38
29 files changed, 111 insertions, 72 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 2fb832648a..4f2c9ea272 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -87,7 +87,7 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle
// Setup class loader first
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
-$phpbb_class_loader_ext = new \phpbb\class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
+$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
// Set up container
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index 1dba6048e9..5edaa6c0fc 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -52,7 +52,7 @@ services:
class_loader.ext:
class: phpbb\class_loader
arguments:
- - phpbb\ext\
+ - \
- %core.root_path%ext/
- %core.php_ext%
calls:
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index f612d11d3c..04d68f6a48 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -50,9 +50,9 @@ if (isset($_GET['avatar']))
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Setup class loader first
- $phpbb_class_loader = new \phpbb\class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx);
+ $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
- $phpbb_class_loader_ext = new \phpbb\class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
+ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
// Set up container
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 8aa72076da..6792886d2a 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -565,7 +565,7 @@ class acp_modules
{
// Skip entries we do not need if we know the module we are
// looking for
- if ($module && strpos($cur_module, $module) === false)
+ if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false)
{
continue;
}
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index ebfec4232f..bdc2e86c53 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -112,7 +112,7 @@ $phpbb_class_loader_new = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}
$phpbb_class_loader_new->register();
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
-$phpbb_class_loader_ext = new \phpbb\class_loader('phpbb\\ext\\', "{$phpbb_root_path}ext/", $phpEx);
+$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
// Set up container
diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php
index 338f1cdeb9..d3e73bc387 100644
--- a/phpBB/phpbb/extension/finder.php
+++ b/phpBB/phpbb/extension/finder.php
@@ -277,15 +277,16 @@ class finder
$classes = array();
foreach ($files as $file => $ext_name)
{
- if (preg_match('#^includes/#', $file))
+ $class = substr($file, 0, -strlen('.' . $this->php_ext));
+ if ($ext_name === '/' && preg_match('#^includes/#', $file))
{
- $file = preg_replace('#^includes/#', '', $file);
- $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen('.' . $this->php_ext)));
+ $class = preg_replace('#^includes/#', '', $class);
+ $classes[] = 'phpbb_' . str_replace('/', '_', $class);
}
else
- {
- $file = preg_replace('#^phpbb/#', '', $file);
- $classes[] = 'phpbb\\' . str_replace('/', '\\', substr($file, 0, -strlen('.' . $this->php_ext)));
+ {
+ $class = preg_replace('#^ext/#', '', $class);
+ $classes[] = str_replace('/', '\\', $class);
}
}
return $classes;
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php
index d174146f52..ce6d7e05c8 100644
--- a/phpBB/phpbb/extension/manager.php
+++ b/phpBB/phpbb/extension/manager.php
@@ -133,7 +133,7 @@ class manager
*/
public function get_extension($name)
{
- $extension_class_name = 'phpbb_ext_' . str_replace('/', '_', $name) . '_ext';
+ $extension_class_name = str_replace('/', '\\', $name) . '\\ext';
$migrator = $this->container->get('migrator');
diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php
index eb50ac1ecd..255b634bd6 100644
--- a/tests/class_loader/class_loader_test.php
+++ b/tests/class_loader/class_loader_test.php
@@ -60,13 +60,13 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
{
$cache_map = array(
'class_loader_phpbb__' => array('phpbb\\a\\cached_name' => 'a/cached_name'),
- 'class_loader_phpbb__ext__' => array('phpbb\\ext\\foo' => 'foo'),
+ 'class_loader___' => array('phpbb\\ext\\foo' => 'foo'),
);
$cache = new phpbb_mock_cache($cache_map);
$prefix = dirname(__FILE__) . '/';
$class_loader = new \phpbb\class_loader('phpbb\\', $prefix . 'phpbb/', 'php', $cache);
- $class_loader_ext = new \phpbb\class_loader('phpbb\\ext\\', $prefix . 'phpbb/', 'php', $cache);
+ $class_loader_ext = new \phpbb\class_loader('\\', $prefix . 'phpbb/', 'php', $cache);
$prefix .= 'phpbb/';
diff --git a/tests/extension/ext/bar/ext.php b/tests/extension/ext/bar/ext.php
index edae25663a..22ff5e8077 100644
--- a/tests/extension/ext/bar/ext.php
+++ b/tests/extension/ext/bar/ext.php
@@ -1,6 +1,8 @@
<?php
-class phpbb_ext_bar_ext extends \phpbb\extension\base
+namespace bar;
+
+class ext extends \phpbb\extension\base
{
static public $state;
diff --git a/tests/extension/ext/barfoo/acp/a_info.php b/tests/extension/ext/barfoo/acp/a_info.php
index cd7e4e574b..ea07189f7a 100644
--- a/tests/extension/ext/barfoo/acp/a_info.php
+++ b/tests/extension/ext/barfoo/acp/a_info.php
@@ -1,11 +1,13 @@
<?php
-class phpbb_ext_barfoo_acp_a_info
+namespace barfoo\acp;
+
+class a_info
{
public function module()
{
return array(
- 'filename' => 'phpbb_ext_barfoo_acp_a_module',
+ 'filename' => 'barfoo\\acp\\a_module',
'title' => 'Barfoo',
'version' => '3.1.0-dev',
'modes' => array(
diff --git a/tests/extension/ext/barfoo/acp/a_module.php b/tests/extension/ext/barfoo/acp/a_module.php
index 5bedb49645..0ae8775013 100644
--- a/tests/extension/ext/barfoo/acp/a_module.php
+++ b/tests/extension/ext/barfoo/acp/a_module.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_barfoo_acp_a_module
+namespace barfoo\acp;
+
+class a_module
{
}
diff --git a/tests/extension/ext/barfoo/ext.php b/tests/extension/ext/barfoo/ext.php
index c1425369fa..1b7bb7ca5e 100644
--- a/tests/extension/ext/barfoo/ext.php
+++ b/tests/extension/ext/barfoo/ext.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_barfoo_ext extends \phpbb\extension\base
+namespace barfoo;
+
+class ext extends \phpbb\extension\base
{
}
diff --git a/tests/extension/ext/foo/a_class.php b/tests/extension/ext/foo/a_class.php
index b7be1ad654..9db45a697f 100644
--- a/tests/extension/ext/foo/a_class.php
+++ b/tests/extension/ext/foo/a_class.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_a_class
+namespace foo;
+
+class a_class
{
}
diff --git a/tests/extension/ext/foo/acp/a_info.php b/tests/extension/ext/foo/acp/a_info.php
index 3e9bbffaca..3b7d8cdd42 100644
--- a/tests/extension/ext/foo/acp/a_info.php
+++ b/tests/extension/ext/foo/acp/a_info.php
@@ -1,11 +1,13 @@
<?php
-class phpbb_ext_foo_acp_a_info
+namespace foo\acp;
+
+class a_info
{
public function module()
{
return array(
- 'filename' => 'phpbb_ext_foo_acp_a_module',
+ 'filename' => 'foo\\acp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
diff --git a/tests/extension/ext/foo/acp/a_module.php b/tests/extension/ext/foo/acp/a_module.php
index 093b4b1ad7..7aa2351ab3 100644
--- a/tests/extension/ext/foo/acp/a_module.php
+++ b/tests/extension/ext/foo/acp/a_module.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_acp_a_module
+namespace foo\acp;
+
+class a_module
{
}
diff --git a/tests/extension/ext/foo/acp/fail_info.php b/tests/extension/ext/foo/acp/fail_info.php
index 99aa09551e..caea441f99 100644
--- a/tests/extension/ext/foo/acp/fail_info.php
+++ b/tests/extension/ext/foo/acp/fail_info.php
@@ -1,9 +1,12 @@
<?php
+
+namespace foo\acp;
+
/*
* Due to the mismatch between the class name and the file name, this module
* file shouldn't be found by the extension finder
*/
-class phpbb_ext_foo_acp_foo_info
+class foo_info
{
public function module()
{
diff --git a/tests/extension/ext/foo/acp/fail_module.php b/tests/extension/ext/foo/acp/fail_module.php
index a200d92d2f..8070929d3c 100644
--- a/tests/extension/ext/foo/acp/fail_module.php
+++ b/tests/extension/ext/foo/acp/fail_module.php
@@ -1,8 +1,11 @@
<?php
+
+namespace foo\acp;
+
/*
* Due to the mismatch between the class name and the file name of the module
* info file, this module's info file shouldn't be found
*/
-class phpbb_ext_foo_acp_fail_module
+class fail_module
{
}
diff --git a/tests/extension/ext/foo/b_class.php b/tests/extension/ext/foo/b_class.php
index 4645266122..bb2a77c05e 100644
--- a/tests/extension/ext/foo/b_class.php
+++ b/tests/extension/ext/foo/b_class.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_b_class
+namespace foo;
+
+class b_class
{
}
diff --git a/tests/extension/ext/foo/ext.php b/tests/extension/ext/foo/ext.php
index f604dcab5f..ac6098f2f1 100644
--- a/tests/extension/ext/foo/ext.php
+++ b/tests/extension/ext/foo/ext.php
@@ -1,6 +1,8 @@
<?php
-class phpbb_ext_foo_ext extends \phpbb\extension\base
+namespace foo;
+
+class ext extends \phpbb\extension\base
{
static public $disabled;
diff --git a/tests/extension/ext/foo/mcp/a_info.php b/tests/extension/ext/foo/mcp/a_info.php
index 84a36b9134..9a896ce808 100644
--- a/tests/extension/ext/foo/mcp/a_info.php
+++ b/tests/extension/ext/foo/mcp/a_info.php
@@ -1,11 +1,13 @@
<?php
-class phpbb_ext_foo_mcp_a_info
+namespace foo\mcp;
+
+class a_info
{
public function module()
{
return array(
- 'filename' => 'phpbb_ext_foo_mcp_a_module',
+ 'filename' => 'foo\\mcp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
diff --git a/tests/extension/ext/foo/mcp/a_module.php b/tests/extension/ext/foo/mcp/a_module.php
index 59d9f8cc6f..ca397e7004 100644
--- a/tests/extension/ext/foo/mcp/a_module.php
+++ b/tests/extension/ext/foo/mcp/a_module.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_mcp_a_module
+namespace foo\mcp;
+
+class a_module
{
}
diff --git a/tests/extension/ext/foo/sub/type/alternative.php b/tests/extension/ext/foo/sub/type/alternative.php
index 2ea7353f4b..1eaf794609 100644
--- a/tests/extension/ext/foo/sub/type/alternative.php
+++ b/tests/extension/ext/foo/sub/type/alternative.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_sub_type_alternative
+namespace foo\sub\type;
+
+class alternative
{
}
diff --git a/tests/extension/ext/foo/type/alternative.php b/tests/extension/ext/foo/type/alternative.php
index 404b66b965..8f753491ef 100644
--- a/tests/extension/ext/foo/type/alternative.php
+++ b/tests/extension/ext/foo/type/alternative.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_type_alternative
+namespace foo\type;
+
+class alternative
{
}
diff --git a/tests/extension/ext/foo/typewrong/error.php b/tests/extension/ext/foo/typewrong/error.php
index ba22cfae9a..5020926043 100644
--- a/tests/extension/ext/foo/typewrong/error.php
+++ b/tests/extension/ext/foo/typewrong/error.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_foo_typewrong_error
+namespace foo\typewrong;
+
+class error
{
}
diff --git a/tests/extension/ext/vendor/moo/ext.php b/tests/extension/ext/vendor/moo/ext.php
index 82657ece77..41ef570452 100644
--- a/tests/extension/ext/vendor/moo/ext.php
+++ b/tests/extension/ext/vendor/moo/ext.php
@@ -1,6 +1,8 @@
<?php
-class phpbb_ext_vendor_moo_ext extends \phpbb\extension\base
+namespace vendor\moo;
+
+class ext extends \phpbb\extension\base
{
static public $purged;
diff --git a/tests/extension/ext/vendor/moo/feature_class.php b/tests/extension/ext/vendor/moo/feature_class.php
index c3bcc4451c..cb8bb3da56 100644
--- a/tests/extension/ext/vendor/moo/feature_class.php
+++ b/tests/extension/ext/vendor/moo/feature_class.php
@@ -1,5 +1,7 @@
<?php
-class phpbb_ext_vendor_moo_feature_class
+namespace vendor\moo;
+
+class feature_class
{
}
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php
index f1e7bc02b9..d6f9e93478 100644
--- a/tests/extension/finder_test.php
+++ b/tests/extension/finder_test.php
@@ -43,10 +43,10 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
+ 'bar\my\hidden_class',
+ 'foo\a_class',
+ 'foo\b_class',
'phpbb\default\implementation',
- 'phpbb\ext\bar\my\hidden_class',
- 'phpbb\ext\foo\a_class',
- 'phpbb\ext\foo\b_class',
),
$classes
);
@@ -88,8 +88,8 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
+ 'bar\my\hidden_class',
'phpbb\default\implementation',
- 'phpbb\ext\bar\my\hidden_class',
),
$classes
);
@@ -105,9 +105,9 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
+ 'foo\sub\type\alternative',
+ 'foo\type\alternative',
'phpbb\default\implementation',
- 'phpbb\ext\foo\sub\type\alternative',
- 'phpbb\ext\foo\type\alternative',
),
$classes
);
@@ -122,7 +122,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
- 'phpbb\ext\foo\type\alternative',
+ 'foo\type\alternative',
),
$classes
);
@@ -137,7 +137,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
- 'phpbb\ext\foo\sub\type\alternative',
+ 'foo\sub\type\alternative',
),
$classes
);
@@ -152,7 +152,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
- 'phpbb\ext\foo\sub\type\alternative',
+ 'foo\sub\type\alternative',
),
$classes
);
@@ -168,8 +168,8 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(
- 'phpbb\ext\foo\type\alternative',
- 'phpbb\ext\foo\type\dummy\empty',
+ 'foo\type\alternative',
+ 'foo\type\dummy\empty',
),
$classes
);
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index fd9e800c02..b127daf2ed 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -45,31 +45,31 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
public function test_enable()
{
- phpbb_ext_bar_ext::$state = 0;
+ bar\ext::$state = 0;
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
$this->extension_manager->enable('bar');
$this->assertEquals(array('bar', 'foo'), array_keys($this->extension_manager->all_enabled()));
$this->assertEquals(array('bar', 'foo', 'vendor/moo'), array_keys($this->extension_manager->all_configured()));
- $this->assertEquals(4, phpbb_ext_bar_ext::$state);
+ $this->assertEquals(4, bar\ext::$state);
}
public function test_disable()
{
- phpbb_ext_foo_ext::$disabled = false;
+ foo\ext::$disabled = false;
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
$this->extension_manager->disable('foo');
$this->assertEquals(array(), array_keys($this->extension_manager->all_enabled()));
$this->assertEquals(array('foo', 'vendor/moo'), array_keys($this->extension_manager->all_configured()));
- $this->assertTrue(phpbb_ext_foo_ext::$disabled);
+ $this->assertTrue(foo\ext::$disabled);
}
public function test_purge()
{
- phpbb_ext_vendor_moo_ext::$purged = false;
+ vendor\moo\ext::$purged = false;
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
$this->assertEquals(array('foo', 'vendor/moo'), array_keys($this->extension_manager->all_configured()));
@@ -77,7 +77,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_configured()));
- $this->assertTrue(phpbb_ext_vendor_moo_ext::$purged);
+ $this->assertTrue(vendor\moo\ext::$purged);
}
public function test_enabled_no_cache()
diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php
index 96655ff90f..ef21c943c2 100644
--- a/tests/extension/modules_test.php
+++ b/tests/extension/modules_test.php
@@ -45,7 +45,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
{
global $phpbb_root_path;
- $this->markTestIncomplete('Modules no speak namespace! Going to get rid of db modules altogether and fix this test after.');
+// $this->markTestIncomplete('Modules no speak namespace! Going to get rid of db modules altogether and fix this test after.');
// Correctly set the root path for this test to this directory, so the classes can be found
$phpbb_root_path = dirname(__FILE__) . '/';
@@ -54,8 +54,8 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->acp_modules->module_class = 'acp';
$acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array(
- 'phpbb_ext_foo_acp_a_module' => array(
- 'filename' => 'phpbb_ext_foo_acp_a_module',
+ 'foo\\acp\\a_module' => array(
+ 'filename' => 'foo\\acp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
@@ -76,8 +76,8 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array(
- 'phpbb_ext_foo_mcp_a_module' => array(
- 'filename' => 'phpbb_ext_foo_mcp_a_module',
+ 'foo\\mcp\\a_module' => array(
+ 'filename' => 'foo\\mcp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
@@ -90,8 +90,8 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos('mcp_a_module');
$this->assertEquals(array(
- 'phpbb_ext_foo_mcp_a_module' => array(
- 'filename' => 'phpbb_ext_foo_mcp_a_module',
+ 'foo\\mcp\\a_module' => array(
+ 'filename' => 'foo\\mcp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
@@ -104,8 +104,8 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->acp_modules->module_class = '';
$acp_modules = $this->acp_modules->get_module_infos('mcp_a_module', 'mcp');
$this->assertEquals(array(
- 'phpbb_ext_foo_mcp_a_module' => array(
- 'filename' => 'phpbb_ext_foo_mcp_a_module',
+ 'foo\\mcp\\a_module' => array(
+ 'filename' => 'foo\\mcp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
@@ -126,10 +126,10 @@ class phpbb_extension_modules_test extends phpbb_test_case
// Get module info of specified extension module
$this->acp_modules->module_class = 'acp';
- $acp_modules = $this->acp_modules->get_module_infos('phpbb_ext_foo_acp_a_module');
+ $acp_modules = $this->acp_modules->get_module_infos('foo_acp_a_module');
$this->assertEquals(array(
- 'phpbb_ext_foo_acp_a_module' => array (
- 'filename' => 'phpbb_ext_foo_acp_a_module',
+ 'foo\\acp\\a_module' => array (
+ 'filename' => 'foo\\acp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array (
@@ -152,8 +152,8 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->acp_modules->module_class = 'acp';
$acp_modules = $this->acp_modules->get_module_infos('', false, true);
$this->assertEquals(array(
- 'phpbb_ext_foo_acp_a_module' => array(
- 'filename' => 'phpbb_ext_foo_acp_a_module',
+ 'foo\\acp\\a_module' => array(
+ 'filename' => 'foo\\acp\\a_module',
'title' => 'Foobar',
'version' => '3.1.0-dev',
'modes' => array(
@@ -168,8 +168,8 @@ class phpbb_extension_modules_test extends phpbb_test_case
'test' => array('title' => 'Test', 'auth' => '', 'cat' => array('ACP_GENERAL')),
),
),
- 'phpbb_ext_barfoo_acp_a_module' => array(
- 'filename' => 'phpbb_ext_barfoo_acp_a_module',
+ 'barfoo\\acp\\a_module' => array(
+ 'filename' => 'barfoo\\acp\\a_module',
'title' => 'Barfoo',
'version' => '3.1.0-dev',
'modes' => array(
@@ -179,10 +179,10 @@ class phpbb_extension_modules_test extends phpbb_test_case
), $acp_modules);
// Specific module set to disabled extension
- $acp_modules = $this->acp_modules->get_module_infos('phpbb_ext_barfoo_acp_a_module', 'acp', true);
+ $acp_modules = $this->acp_modules->get_module_infos('barfoo_acp_a_module', 'acp', true);
$this->assertEquals(array(
- 'phpbb_ext_barfoo_acp_a_module' => array(
- 'filename' => 'phpbb_ext_barfoo_acp_a_module',
+ 'barfoo\\acp\\a_module' => array(
+ 'filename' => 'barfoo\\acp\\a_module',
'title' => 'Barfoo',
'version' => '3.1.0-dev',
'modes' => array(