From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:01:09 +0200 Subject: [ticket/11700] Move all recent code to namespaces PHPBB3-11700 --- tests/di/create_container_test.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/di/create_container_test.php') diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index b3992dbd80..ffa37d3b3d 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -16,8 +16,8 @@ class phpbb_di_container_test extends phpbb_test_case { $phpbb_root_path = __DIR__ . '/../../phpBB/'; $extensions = array( - new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), - new phpbb_di_extension_core($phpbb_root_path), + new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), + new \phpbb\di\extension\core($phpbb_root_path), ); $container = phpbb_create_container($extensions, $phpbb_root_path, 'php'); @@ -28,8 +28,8 @@ class phpbb_di_container_test extends phpbb_test_case { $phpbb_root_path = __DIR__ . '/../../phpBB/'; $extensions = array( - new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), - new phpbb_di_extension_core($phpbb_root_path), + new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), + new \phpbb\di\extension\core($phpbb_root_path), ); $container = phpbb_create_install_container($phpbb_root_path, 'php'); @@ -42,8 +42,8 @@ class phpbb_di_container_test extends phpbb_test_case $phpbb_root_path = __DIR__ . '/../../phpBB/'; $config_file = __DIR__ . '/fixtures/config.php'; $extensions = array( - new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), - new phpbb_di_extension_core($phpbb_root_path), + new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), + new \phpbb\di\extension\core($phpbb_root_path), ); $container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php'); @@ -52,7 +52,7 @@ class phpbb_di_container_test extends phpbb_test_case } } -class phpbb_db_driver_container_mock extends phpbb_db_driver +class phpbb_db_driver_container_mock extends \phpbb\db\driver\driver { public function sql_connect() { -- cgit v1.2.1 From 9a2c29a175085a424e4c638853da22f2cb83f12d Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 16:22:02 +0200 Subject: [ticket/11700] DI container test needs namespaces to work properly PHPBB3-11700 --- tests/di/create_container_test.php | 106 ++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 50 deletions(-) (limited to 'tests/di/create_container_test.php') diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index ffa37d3b3d..8d3dfea780 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -7,66 +7,72 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions_container.php'; - -class phpbb_di_container_test extends phpbb_test_case +namespace { - public function test_phpbb_create_container() - { - $phpbb_root_path = __DIR__ . '/../../phpBB/'; - $extensions = array( - new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), - new \phpbb\di\extension\core($phpbb_root_path), - ); - $container = phpbb_create_container($extensions, $phpbb_root_path, 'php'); + require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + require_once dirname(__FILE__) . '/../../phpBB/includes/functions_container.php'; + + class phpbb_di_container_test extends phpbb_test_case + { + public function test_phpbb_create_container() + { + $phpbb_root_path = __DIR__ . '/../../phpBB/'; + $extensions = array( + new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), + new \phpbb\di\extension\core($phpbb_root_path), + ); + $container = phpbb_create_container($extensions, $phpbb_root_path, 'php'); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); - } + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); + } - public function test_phpbb_create_install_container() - { - $phpbb_root_path = __DIR__ . '/../../phpBB/'; - $extensions = array( - new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), - new \phpbb\di\extension\core($phpbb_root_path), - ); - $container = phpbb_create_install_container($phpbb_root_path, 'php'); + public function test_phpbb_create_install_container() + { + $phpbb_root_path = __DIR__ . '/../../phpBB/'; + $extensions = array( + new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), + new \phpbb\di\extension\core($phpbb_root_path), + ); + $container = phpbb_create_install_container($phpbb_root_path, 'php'); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); - $this->assertTrue($container->isFrozen()); - } + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); + $this->assertTrue($container->isFrozen()); + } - public function test_phpbb_create_compiled_container() - { - $phpbb_root_path = __DIR__ . '/../../phpBB/'; - $config_file = __DIR__ . '/fixtures/config.php'; - $extensions = array( - new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), - new \phpbb\di\extension\core($phpbb_root_path), - ); - $container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php'); + public function test_phpbb_create_compiled_container() + { + $phpbb_root_path = __DIR__ . '/../../phpBB/'; + $config_file = __DIR__ . '/fixtures/config.php'; + $extensions = array( + new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'), + new \phpbb\di\extension\core($phpbb_root_path), + ); + $container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php'); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); - $this->assertTrue($container->isFrozen()); - } + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); + $this->assertTrue($container->isFrozen()); + } + } } -class phpbb_db_driver_container_mock extends \phpbb\db\driver\driver +namespace phpbb\db\driver { - public function sql_connect() - { - } + class container_mock extends \phpbb\db\driver\driver + { + public function sql_connect() + { + } - public function sql_query() - { - } + public function sql_query() + { + } - public function sql_fetchrow() - { - } + public function sql_fetchrow() + { + } - public function sql_freeresult() - { - } + public function sql_freeresult() + { + } + } } -- cgit v1.2.1