mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
[ticket/11386] Send list of migrations instead of using load_migrations
Remove dependency of extension manager for migrator. Keeping load_migrations function for others to use if they desire but requiring the finder be sent to it in order to use it. PHPBB3-11386
This commit is contained in:
@@ -45,15 +45,6 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||
new phpbb_db_migration_tool_config($this->config),
|
||||
);
|
||||
|
||||
$this->extension_manager = new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$this->db,
|
||||
$this->config,
|
||||
'phpbb_ext',
|
||||
dirname(__FILE__) . '/../../phpBB/',
|
||||
'.php',
|
||||
null
|
||||
);
|
||||
$this->migrator = new phpbb_db_migrator(
|
||||
$this->config,
|
||||
$this->db,
|
||||
@@ -64,7 +55,16 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||
'phpbb_',
|
||||
$tools
|
||||
);
|
||||
$this->migrator->set_extension_manager($this->extension_manager);
|
||||
$this->extension_manager = new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$this->db,
|
||||
$this->config,
|
||||
$this->migrator,
|
||||
'phpbb_ext',
|
||||
dirname(__FILE__) . '/../../phpBB/',
|
||||
'.php',
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public function test_update()
|
||||
|
@@ -97,15 +97,6 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
$php_ext = 'php';
|
||||
$table_prefix = 'phpbb_';
|
||||
|
||||
$manager = new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$db,
|
||||
$config,
|
||||
'phpbb_ext',
|
||||
dirname(__FILE__) . '/',
|
||||
'.' . $php_ext,
|
||||
($with_cache) ? new phpbb_mock_cache() : null
|
||||
);
|
||||
$migrator = new phpbb_db_migrator(
|
||||
$config,
|
||||
$db,
|
||||
@@ -116,9 +107,15 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
$table_prefix,
|
||||
array()
|
||||
);
|
||||
$manager->set_migrator($migrator);
|
||||
$migrator->set_extension_manager($manager);
|
||||
|
||||
return $manager;
|
||||
return new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$db,
|
||||
$config,
|
||||
$migrator,
|
||||
'phpbb_ext',
|
||||
dirname(__FILE__) . '/',
|
||||
'.' . $php_ext,
|
||||
($with_cache) ? new phpbb_mock_cache() : null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -49,10 +49,21 @@ class metadata_manager_test extends phpbb_database_test_case
|
||||
new phpbb_template_context()
|
||||
);
|
||||
|
||||
$this->migrator = new phpbb_db_migrator(
|
||||
$this->config,
|
||||
$this->db,
|
||||
$this->db_tools,
|
||||
'phpbb_migrations',
|
||||
$this->phpbb_root_path,
|
||||
'php',
|
||||
$this->table_prefix,
|
||||
array()
|
||||
);
|
||||
$this->extension_manager = new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$this->db,
|
||||
$this->config,
|
||||
$this->migrator,
|
||||
'phpbb_ext',
|
||||
$this->phpbb_root_path,
|
||||
$this->phpEx,
|
||||
|
@@ -138,15 +138,6 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
$db = $this->get_db();
|
||||
$db_tools = new phpbb_db_tools($db);
|
||||
|
||||
$extension_manager = new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$db,
|
||||
$config,
|
||||
self::$config['table_prefix'] . 'ext',
|
||||
dirname(__FILE__) . '/',
|
||||
'.' . $php_ext,
|
||||
$this->get_cache_driver()
|
||||
);
|
||||
$migrator = new phpbb_db_migrator(
|
||||
$config,
|
||||
$db,
|
||||
@@ -157,8 +148,16 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
self::$config['table_prefix'],
|
||||
array()
|
||||
);
|
||||
$extension_manager->set_migrator($migrator);
|
||||
$migrator->set_extension_manager($extension_manager);
|
||||
$extension_manager = new phpbb_extension_manager(
|
||||
new phpbb_mock_container_builder(),
|
||||
$db,
|
||||
$config,
|
||||
$migrator,
|
||||
self::$config['table_prefix'] . 'ext',
|
||||
dirname(__FILE__) . '/',
|
||||
'.' . $php_ext,
|
||||
$this->get_cache_driver()
|
||||
);
|
||||
|
||||
return $extension_manager;
|
||||
}
|
||||
|
Reference in New Issue
Block a user