2012-11-11 17:56:09 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @package testing
|
|
|
|
* @copyright (c) 2012 phpBB Group
|
|
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
namespace
|
2012-11-11 17:56:09 +01:00
|
|
|
{
|
2013-09-10 16:22:02 +02:00
|
|
|
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'),
|
2013-09-16 01:24:05 +02:00
|
|
|
new \phpbb\di\extension\core($phpbb_root_path . 'config'),
|
2013-09-10 16:22:02 +02:00
|
|
|
);
|
|
|
|
$container = phpbb_create_container($extensions, $phpbb_root_path, 'php');
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
public function test_phpbb_create_install_container()
|
|
|
|
{
|
|
|
|
$phpbb_root_path = __DIR__ . '/../../phpBB/';
|
|
|
|
$extensions = array(
|
|
|
|
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
|
2013-09-16 01:24:05 +02:00
|
|
|
new \phpbb\di\extension\core($phpbb_root_path . 'config'),
|
2013-09-10 16:22:02 +02:00
|
|
|
);
|
|
|
|
$container = phpbb_create_install_container($phpbb_root_path, 'php');
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
|
|
|
|
$this->assertTrue($container->isFrozen());
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
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'),
|
2013-09-16 01:24:05 +02:00
|
|
|
new \phpbb\di\extension\core($phpbb_root_path . 'config'),
|
2013-09-10 16:22:02 +02:00
|
|
|
);
|
|
|
|
$container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php');
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
|
|
|
|
$this->assertTrue($container->isFrozen());
|
|
|
|
}
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
}
|
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
namespace phpbb\db\driver
|
2012-11-11 17:56:09 +01:00
|
|
|
{
|
2013-09-10 16:22:02 +02:00
|
|
|
class container_mock extends \phpbb\db\driver\driver
|
|
|
|
{
|
|
|
|
public function sql_connect()
|
|
|
|
{
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
public function sql_query()
|
|
|
|
{
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
public function sql_fetchrow()
|
|
|
|
{
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
|
2013-09-10 16:22:02 +02:00
|
|
|
public function sql_freeresult()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2012-11-11 17:56:09 +01:00
|
|
|
}
|