aboutsummaryrefslogtreecommitdiffstats
path: root/tests/files
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-02-04 17:10:59 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-02-04 17:14:48 +0100
commitfd9c05309d186332728b533467aaecad5c543c52 (patch)
treedc5738e6d3ab1ee32ffa6c3145429fc88eb2c979 /tests/files
parent9a5b2d5e66c2b9bea16f22589b0a2507f766fd9d (diff)
downloadforums-fd9c05309d186332728b533467aaecad5c543c52.tar
forums-fd9c05309d186332728b533467aaecad5c543c52.tar.gz
forums-fd9c05309d186332728b533467aaecad5c543c52.tar.bz2
forums-fd9c05309d186332728b533467aaecad5c543c52.tar.xz
forums-fd9c05309d186332728b533467aaecad5c543c52.zip
[ticket/14448] Let user decide if remote upload certs should be checked
Also fixed some minor issues like coding style. PHPBB3-14448
Diffstat (limited to 'tests/files')
-rw-r--r--tests/files/types_remote_test.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/files/types_remote_test.php b/tests/files/types_remote_test.php
index 3f32f9ce75..476d8ed3ba 100644
--- a/tests/files/types_remote_test.php
+++ b/tests/files/types_remote_test.php
@@ -20,6 +20,9 @@ class phpbb_files_types_remote_test extends phpbb_test_case
private $filesystem;
+ /** @var \phpbb\config\config */
+ protected $config;
+
/** @var \Symfony\Component\DependencyInjection\ContainerInterface */
protected $container;
@@ -43,6 +46,8 @@ class phpbb_files_types_remote_test extends phpbb_test_case
global $config, $phpbb_root_path, $phpEx;
$config = new \phpbb\config\config(array());
+ $this->config = $config;
+ $this->config->set('remote_upload_verify', 0);
$this->request = $this->getMock('\phpbb\request\request');
$this->filesystem = new \phpbb\filesystem\filesystem();
@@ -67,7 +72,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->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
+ $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$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);
@@ -102,7 +107,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->factory, $this->language, $php_ini, $this->request, $this->phpbb_root_path);
+ $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->language, $php_ini, $this->request, $this->phpbb_root_path);
$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);
@@ -114,7 +119,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->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
+ $type_remote = new \phpbb\files\types\foo($this->config, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$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);