mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[feature/migrations] Fix failing tests (again)
PHPBB3-11318
This commit is contained in:
parent
3a68bba2fb
commit
193a3beb8f
3 changed files with 39 additions and 38 deletions
|
@ -25,23 +25,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$config = new phpbb_config(array());
|
$this->extension_manager = $this->create_extension_manager();
|
||||||
$db = $this->new_dbal();
|
|
||||||
$db_tools = new phpbb_db_tools($db);
|
|
||||||
$phpbb_root_path = __DIR__ . './../../phpBB/';
|
|
||||||
$php_ext = 'php';
|
|
||||||
$table_prefix = 'phpbb_';
|
|
||||||
|
|
||||||
$this->extension_manager = new phpbb_extension_manager(
|
|
||||||
new phpbb_mock_container_builder(),
|
|
||||||
$db,
|
|
||||||
$config,
|
|
||||||
new phpbb_db_migrator($config, $db, $db_tools, 'phpbb_migrations', $phpbb_root_path, $php_ext, $table_prefix, array()),
|
|
||||||
'phpbb_ext',
|
|
||||||
dirname(__FILE__) . '/',
|
|
||||||
'.' . $php_ext,
|
|
||||||
new phpbb_mock_cache()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_available()
|
public function test_available()
|
||||||
|
@ -98,16 +82,30 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||||
|
|
||||||
public function test_enabled_no_cache()
|
public function test_enabled_no_cache()
|
||||||
{
|
{
|
||||||
$extension_manager = new phpbb_extension_manager(
|
$extension_manager = $this->create_extension_manager(false);
|
||||||
new phpbb_mock_container_builder(),
|
|
||||||
$this->new_dbal(),
|
|
||||||
new phpbb_config(array()),
|
|
||||||
'phpbb_ext',
|
|
||||||
dirname(__FILE__) . '/',
|
|
||||||
'.php'
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->assertEquals(array('foo'), array_keys($extension_manager->all_enabled()));
|
$this->assertEquals(array('foo'), array_keys($extension_manager->all_enabled()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function create_extension_manager($with_cache = true)
|
||||||
|
{
|
||||||
|
|
||||||
|
$config = new phpbb_config(array());
|
||||||
|
$db = $this->new_dbal();
|
||||||
|
$db_tools = new phpbb_db_tools($db);
|
||||||
|
$phpbb_root_path = __DIR__ . './../../phpBB/';
|
||||||
|
$php_ext = 'php';
|
||||||
|
$table_prefix = 'phpbb_';
|
||||||
|
|
||||||
|
return new phpbb_extension_manager(
|
||||||
|
new phpbb_mock_container_builder(),
|
||||||
|
$db,
|
||||||
|
$config,
|
||||||
|
new phpbb_db_migrator($config, $db, $db_tools, 'phpbb_migrations', $phpbb_root_path, $php_ext, $table_prefix, array()),
|
||||||
|
'phpbb_ext',
|
||||||
|
dirname(__FILE__) . '/',
|
||||||
|
'.' . $php_ext,
|
||||||
|
($with_cache) ? new phpbb_mock_cache() : null
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,11 @@ class metadata_manager_test extends phpbb_database_test_case
|
||||||
'version' => '3.1.0',
|
'version' => '3.1.0',
|
||||||
));
|
));
|
||||||
$this->db = $this->new_dbal();
|
$this->db = $this->new_dbal();
|
||||||
|
$this->db_tools = new phpbb_db_tools($this->db);
|
||||||
$this->phpbb_root_path = dirname(__FILE__) . '/';
|
$this->phpbb_root_path = dirname(__FILE__) . '/';
|
||||||
$this->phpEx = '.php';
|
$this->phpEx = '.php';
|
||||||
$this->user = new phpbb_user();
|
$this->user = new phpbb_user();
|
||||||
|
$this->table_prefix = 'phpbb_';
|
||||||
|
|
||||||
$this->template = new phpbb_template(
|
$this->template = new phpbb_template(
|
||||||
$this->phpbb_root_path,
|
$this->phpbb_root_path,
|
||||||
|
@ -51,6 +53,7 @@ class metadata_manager_test extends phpbb_database_test_case
|
||||||
new phpbb_mock_container_builder(),
|
new phpbb_mock_container_builder(),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->config,
|
$this->config,
|
||||||
|
new phpbb_db_migrator($this->config, $this->db, $this->db_tools, 'phpbb_migrations', $this->phpbb_root_path, $this->php_ext, $this->table_prefix, array()),
|
||||||
'phpbb_ext',
|
'phpbb_ext',
|
||||||
$this->phpbb_root_path,
|
$this->phpbb_root_path,
|
||||||
$this->phpEx,
|
$this->phpEx,
|
||||||
|
|
|
@ -134,20 +134,20 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
if (!$this->extension_manager)
|
$config = new phpbb_config(array());
|
||||||
{
|
$db = $this->get_db();
|
||||||
$this->extension_manager = new phpbb_extension_manager(
|
$db_tools = new phpbb_db_tools($db);
|
||||||
new phpbb_mock_container_builder(),
|
|
||||||
$this->get_db(),
|
|
||||||
new phpbb_config(array()),
|
|
||||||
self::$config['table_prefix'] . 'ext',
|
|
||||||
$phpbb_root_path,
|
|
||||||
".$phpEx",
|
|
||||||
$this->get_cache_driver()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->extension_manager;
|
return new phpbb_extension_manager(
|
||||||
|
new phpbb_mock_container_builder(),
|
||||||
|
$db,
|
||||||
|
$config,
|
||||||
|
new phpbb_db_migrator($config, $db, $db_tools, self::$config['table_prefix'] . 'migrations', $phpbb_root_path, $php_ext, self::$config['table_prefix'], array()),
|
||||||
|
self::$config['table_prefix'] . 'ext',
|
||||||
|
dirname(__FILE__) . '/',
|
||||||
|
'.' . $php_ext,
|
||||||
|
$this->get_cache_driver()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static protected function install_board()
|
static protected function install_board()
|
||||||
|
|
Loading…
Add table
Reference in a new issue