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

[ticket/15692] Update tests

PHPBB3-15692
This commit is contained in:
Rubén Calvo
2018-08-07 00:23:47 +02:00
parent 5fbe929a1d
commit d0b7875b18
5 changed files with 9 additions and 47 deletions

View File

@@ -86,9 +86,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
));
$config = $this->config;
$this->db = $this->new_dbal();
$db_mock = $this->createMock('\phpbb\db\driver\driver_interface');
$this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), $this->config, $this->db, $phpbb_root_path, $phpEx);
$cache_mock = $this->createMock('\phpbb\cache\driver\driver_interface');
$this->request = $this->createMock('\phpbb\request\request');
$this->filesystem = new \phpbb\filesystem\filesystem();
@@ -105,13 +103,10 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
$this->mimetype_guesser = new \phpbb\mimetype\guesser($guessers);
$this->plupload = new \phpbb\plupload\plupload($phpbb_root_path, $this->config, $this->request, new \phpbb\user($this->language, '\phpbb\datetime'), $this->php_ini, $this->mimetype_guesser);
$adapter = new \phpbb\storage\adapter\local($this->filesystem, new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path);
$adapter->configure(['path' => 'files']);
$adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory');
$adapter_factory_mock->expects($this->any())
->method('get')
->willReturn($adapter);
$this->storage = new \phpbb\storage\storage($db_mock, $cache_mock, $adapter_factory_mock, '', '');
$this->storage = $this->createMock('\phpbb\storage\storage');
$this->storage->expects($this->any())
->method('free_space')
->willReturn(1024*1024); // 1gb
$factory_mock = $this->getMockBuilder('\phpbb\files\factory')
->disableOriginalConstructor()