mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/11700] DI container test needs namespaces to work properly
PHPBB3-11700
This commit is contained in:
parent
dc2f4a3663
commit
9a2c29a175
1 changed files with 56 additions and 50 deletions
|
@ -7,66 +7,72 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
namespace
|
||||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_container.php';
|
|
||||||
|
|
||||||
class phpbb_di_container_test extends phpbb_test_case
|
|
||||||
{
|
{
|
||||||
public function test_phpbb_create_container()
|
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
||||||
{
|
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_container.php';
|
||||||
$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);
|
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');
|
||||||
|
|
||||||
public function test_phpbb_create_install_container()
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $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);
|
public function test_phpbb_create_install_container()
|
||||||
$this->assertTrue($container->isFrozen());
|
{
|
||||||
}
|
$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_compiled_container()
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
|
||||||
{
|
$this->assertTrue($container->isFrozen());
|
||||||
$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);
|
public function test_phpbb_create_compiled_container()
|
||||||
$this->assertTrue($container->isFrozen());
|
{
|
||||||
}
|
$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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue