diff options
Diffstat (limited to 'tests/files/types_remote_test.php')
-rw-r--r-- | tests/files/types_remote_test.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/files/types_remote_test.php b/tests/files/types_remote_test.php index d42a609fbb..3b3d61acac 100644 --- a/tests/files/types_remote_test.php +++ b/tests/files/types_remote_test.php @@ -15,10 +15,15 @@ require_once dirname(__FILE__) . '/type_foo.php'; class phpbb_files_types_remote_test extends phpbb_test_case { + /** @var string */ private $path; + /** @var \phpbb\filesystem\filesystem */ private $filesystem; + /** @var \phpbb\filesystem\temp */ + private $temp; + /** @var \phpbb\config\config */ protected $config; @@ -49,7 +54,9 @@ class phpbb_files_types_remote_test extends phpbb_test_case $this->config->set('remote_upload_verify', 0); $this->request = $this->createMock('\phpbb\request\request'); + $cache_path = $phpbb_root_path . 'cache/files'; $this->filesystem = new \phpbb\filesystem\filesystem(); + $this->temp = new \phpbb\filesystem\temp($this->filesystem, $cache_path); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; @@ -71,7 +78,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case public function test_upload_fsock_fail() { - $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); + $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->temp, $this->language, $this->php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_remote->set_upload($upload); @@ -106,7 +113,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case $php_ini->expects($this->any()) ->method('getString') ->willReturn($max_file_size); - $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->language, $php_ini, $this->request, $this->phpbb_root_path); + $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->temp, $this->language, $php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_remote->set_upload($upload); @@ -118,7 +125,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case public function test_upload_wrong_path() { - $type_remote = new \phpbb\files\types\foo($this->config, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); + $type_remote = new \phpbb\files\types\foo($this->config, $this->factory, $this->temp, $this->language, $this->php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_remote->set_upload($upload); |