1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

[ticket/16346] Fix method arguments

PHPBB3-16346
This commit is contained in:
rubencm
2020-08-14 18:42:50 +00:00
parent 758c28ca69
commit 490ddbc2cd
46 changed files with 78 additions and 144 deletions

View File

@@ -28,8 +28,6 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case
protected function setUp(): void
{
global $phpbb_root_path, $phpEx;
$this->cache_dir = dirname(__FILE__) . '/tmp/cache/';
if (file_exists($this->cache_dir))
@@ -45,10 +43,7 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case
$this->db = $this->createMock('\phpbb\db\driver\driver_interface');
$this->config = new \phpbb\config\config(array('assets_version' => 1));
$this->user = $this->createMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime')
);
$this->user = $this->createMock('\phpbb\user');
}
public function test_purge()

View File

@@ -26,10 +26,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
$this->config = new \phpbb\config\config(array());
$this->user = $this->createMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime')
);
$this->user = $this->createMock('\phpbb\user');
$this->user->method('lang')->will($this->returnArgument(0));
}

View File

@@ -34,10 +34,7 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
{
global $phpbb_root_path, $phpEx;
$this->user = $this->createMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$this->user = $this->createMock('\phpbb\user');
$this->user->method('lang')->will($this->returnArgument(0));
}

View File

@@ -40,10 +40,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
$config = $this->config = new \phpbb\config\config(array('cron_lock' => '0'));
$this->lock = new \phpbb\lock\db('cron_lock', $this->config, $this->db);
$this->user = $this->createMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$this->user = $this->createMock('\phpbb\user');
$this->user->method('lang')->will($this->returnArgument(0));
$this->task = new phpbb_cron_task_simple();

View File

@@ -50,14 +50,11 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
));
$this->db = $this->db = $this->new_dbal();
$this->user = $this->createMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime')
);
$this->user = $this->createMock('\phpbb\user');
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
$this->cache = $this->createMock('\phpbb\cache\service', array(), array(new phpbb_mock_cache(), $this->config, $this->db, $this->phpbb_root_path, $this->phpEx));
$this->cache = $this->createMock('\phpbb\cache\service');
$this->cache->expects(self::any())->method('obtain_attach_extensions')->will(self::returnValue(array(
'png' => array('display_cat' => ATTACHMENT_CATEGORY_IMAGE),
'txt' => array('display_cat' => ATTACHMENT_CATEGORY_NONE),

View File

@@ -84,10 +84,7 @@ class phpbb_console_command_check_test extends phpbb_test_case
$this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
$user = $this->createMock('\phpbb\user', array(), array(
$this->language,
'\phpbb\datetime'
));
$user = $this->createMock('\phpbb\user');
$user->method('lang')->will($this->returnArgument(0));
$cache = $this->getMockBuilder('\phpbb\cache\service')

View File

@@ -62,10 +62,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
$this->language->expects($this->any())
->method('lang')
->will($this->returnArgument(0));
$user = $this->user = $this->createMock('\phpbb\user', array(), array(
$this->language,
'\phpbb\datetime'
));
$user = $this->user = $this->createMock('\phpbb\user');
$this->user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);