diff options
| author | Nils Adermann <naderman@naderman.de> | 2013-09-19 18:29:08 +0200 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2013-09-19 18:29:08 +0200 |
| commit | fe36375a36ec4f816eb07b41630b6c9fa7ff12c8 (patch) | |
| tree | 96e1122b07586d8802601fcfeea7d45b398b5e08 /tests/functional | |
| parent | f205c4fad4c3a82cc4a47beb7f9a8025669a3acb (diff) | |
| download | forums-fe36375a36ec4f816eb07b41630b6c9fa7ff12c8.tar forums-fe36375a36ec4f816eb07b41630b6c9fa7ff12c8.tar.gz forums-fe36375a36ec4f816eb07b41630b6c9fa7ff12c8.tar.bz2 forums-fe36375a36ec4f816eb07b41630b6c9fa7ff12c8.tar.xz forums-fe36375a36ec4f816eb07b41630b6c9fa7ff12c8.zip | |
[ticket/11700] Fix extension loading with namespaces
class loader now expects all classes to be prefixed with a backslash
when resolving paths
PHPBB3-11700
Diffstat (limited to 'tests/functional')
9 files changed, 24 insertions, 11 deletions
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index dc6d9c0f65..41bd48c204 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -78,7 +78,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->phpbb_extension_manager->enable('foo/bar'); $crawler = self::request('GET', 'app.php/foo/baz', array(), false); $this->assert_response_html(500); - $this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text()); + $this->assertContains('Missing value for argument #1: test in class foo\bar\controller\controller:baz', $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index c31a892ce9..0c9e0b1654 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -69,7 +69,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case $modules->update_module_data($parent_data, true); $module_data = array( - 'module_basename' => 'phpbb_ext_foo_bar_acp_main_module', + 'module_basename' => 'foo\\bar\\acp\\main_module', 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => $parent_data['module_id'], @@ -90,7 +90,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case { $this->login(); $this->admin_login(); - $crawler = self::request('GET', 'adm/index.php?i=phpbb_ext_foo_bar_acp_main_module&mode=mode&sid=' . $this->sid); + $crawler = self::request('GET', 'adm/index.php?i=foo\\bar\\acp\\main_module&mode=mode&sid=' . $this->sid); $this->assertContains("Bertie rulez!", $crawler->filter('#main')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } diff --git a/tests/functional/fixtures/ext/foo/bar/acp/main_info.php b/tests/functional/fixtures/ext/foo/bar/acp/main_info.php index 21e38b09b5..2ad6d08503 100644 --- a/tests/functional/fixtures/ext/foo/bar/acp/main_info.php +++ b/tests/functional/fixtures/ext/foo/bar/acp/main_info.php @@ -8,6 +8,8 @@ * */ +namespace foo\bar\acp; + /** * @ignore */ @@ -16,12 +18,12 @@ if (!defined('IN_PHPBB')) exit; } -class phpbb_ext_foo_bar_acp_main_info +class main_info { function module() { return array( - 'filename' => 'phpbb_ext_foo_bar_acp_main_module', + 'filename' => 'foo\bar\acp\main_module', 'title' => 'ACP_FOOBAR_TITLE', 'version' => '1.0.0', 'modes' => array( diff --git a/tests/functional/fixtures/ext/foo/bar/acp/main_module.php b/tests/functional/fixtures/ext/foo/bar/acp/main_module.php index c4ab69fb38..c59b3c6820 100644 --- a/tests/functional/fixtures/ext/foo/bar/acp/main_module.php +++ b/tests/functional/fixtures/ext/foo/bar/acp/main_module.php @@ -8,6 +8,8 @@ * */ +namespace foo\bar\acp; + /** * @ignore */ @@ -16,7 +18,7 @@ if (!defined('IN_PHPBB')) exit; } -class phpbb_ext_foo_bar_acp_main_module +class main_module { var $u_action; diff --git a/tests/functional/fixtures/ext/foo/bar/config/services.yml b/tests/functional/fixtures/ext/foo/bar/config/services.yml index 33ced55af9..3bca4c6567 100644 --- a/tests/functional/fixtures/ext/foo/bar/config/services.yml +++ b/tests/functional/fixtures/ext/foo/bar/config/services.yml @@ -1,6 +1,6 @@ services: foo_bar.controller: - class: phpbb_ext_foo_bar_controller + class: foo\bar\controller\controller arguments: - @controller.helper - @template diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php index 41b2be350b..259d548299 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -1,7 +1,10 @@ <?php + +namespace foo\bar\controller; + use Symfony\Component\HttpFoundation\Response; -class phpbb_ext_foo_bar_controller +class controller { protected $template; diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php index 48688a586a..92e24074ad 100644 --- a/tests/functional/fixtures/ext/foo/bar/event/permission.php +++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php @@ -8,6 +8,8 @@ * */ +namespace foo\bar\event; + /** * @ignore */ @@ -22,7 +24,7 @@ if (!defined('IN_PHPBB')) */ use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class phpbb_ext_foo_bar_event_permission implements EventSubscriberInterface +class permission implements EventSubscriberInterface { static public function getSubscribedEvents() { diff --git a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php index 3d2d0c5325..1409f97470 100644 --- a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php +++ b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php @@ -8,6 +8,8 @@ * */ +namespace foo\bar\event; + /** * @ignore */ @@ -22,7 +24,7 @@ if (!defined('IN_PHPBB')) */ use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class phpbb_ext_foo_bar_event_user_setup implements EventSubscriberInterface +class user_setup implements EventSubscriberInterface { static public function getSubscribedEvents() { diff --git a/tests/functional/fixtures/ext/foo/bar/ext.php b/tests/functional/fixtures/ext/foo/bar/ext.php index b839cef36c..1288edd5ec 100644 --- a/tests/functional/fixtures/ext/foo/bar/ext.php +++ b/tests/functional/fixtures/ext/foo/bar/ext.php @@ -1,6 +1,8 @@ <?php -class phpbb_ext_foo_bar_ext extends \phpbb\extension\base +namespace foo\bar; + +class ext extends \phpbb\extension\base { } |
