1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13162] Use db tools for truncating

PHPBB3-13162
This commit is contained in:
Marc Alexander
2023-12-17 19:49:23 +01:00
parent c31ac7348a
commit 59f387e828
21 changed files with 103 additions and 118 deletions

View File

@@ -22,6 +22,7 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case
protected $cache_dir;
protected $cache;
protected $db;
protected $db_tools;
protected $config;
protected $user;
@@ -42,6 +43,8 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case
$this->cache = new \phpbb\cache\driver\file($this->cache_dir);
$this->db = $this->createMock('\phpbb\db\driver\driver_interface');
$tools_factory = new \phpbb\db\tools\factory();
$this->db_tools = $this->createMock('\phpbb\db\tools\doctrine');
$this->config = new \phpbb\config\config(array('assets_version' => 1));
$this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
@@ -86,7 +89,7 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case
public function get_command_tester()
{
$application = new Application();
$application->add(new purge($this->user, $this->cache, $this->db, $this->createMock('\phpbb\auth\auth'), new \phpbb\log\dummy(), $this->config));
$application->add(new purge($this->user, $this->cache, $this->db, $this->db_tools, $this->createMock('\phpbb\auth\auth'), new \phpbb\log\dummy(), $this->config));
$command = $application->find('cache:purge');
return new CommandTester($command);