1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11700] Fix extension loading with namespaces

class loader now expects all classes to be prefixed with a backslash
when resolving paths

PHPBB3-11700
This commit is contained in:
Nils Adermann
2013-09-19 18:29:08 +02:00
parent f205c4fad4
commit fe36375a36
23 changed files with 72 additions and 46 deletions

View File

@@ -53,11 +53,11 @@ class phpbb_controller_controller_test extends phpbb_test_case
// Autoloading classes within the tests folder does not work
// so I'll include them manually.
if (!class_exists('phpbb_ext_foo_controller'))
if (!class_exists('foo\\controller'))
{
include(__DIR__.'/ext/foo/controller.php');
}
if (!class_exists('phpbb_controller_foo'))
if (!class_exists('phpbb\\controller\\foo'))
{
include(__DIR__.'/phpbb/controller/foo.php');
}
@@ -66,11 +66,11 @@ class phpbb_controller_controller_test extends phpbb_test_case
$symfony_request = new Request();
$symfony_request->attributes->set('_controller', 'foo.controller:handle');
$this->assertEquals($resolver->getController($symfony_request), array(new phpbb_ext_foo_controller, 'handle'));
$this->assertEquals($resolver->getController($symfony_request), array(new foo\controller, 'handle'));
$symfony_request = new Request();
$symfony_request->attributes->set('_controller', 'core_foo.controller:bar');
$this->assertEquals($resolver->getController($symfony_request), array(new phpbb_controller_foo, 'bar'));
$this->assertEquals($resolver->getController($symfony_request), array(new phpbb\controller\foo, 'bar'));
}
}