aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/fileupload_remote_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-06-02 15:29:32 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-09-09 08:27:53 +0200
commit52652ca1824e91ecfe7549167aebd92c314af678 (patch)
tree56f629c9070e635fefa6e09fed95b0868dd7acd5 /tests/functional/fileupload_remote_test.php
parent47f8f2cc88bdcd40087c8e391be1d33d36a2d308 (diff)
downloadforums-52652ca1824e91ecfe7549167aebd92c314af678.tar
forums-52652ca1824e91ecfe7549167aebd92c314af678.tar.gz
forums-52652ca1824e91ecfe7549167aebd92c314af678.tar.bz2
forums-52652ca1824e91ecfe7549167aebd92c314af678.tar.xz
forums-52652ca1824e91ecfe7549167aebd92c314af678.zip
[ticket/13904] Remove phpbb_root_path global from upload class
PHPBB3-13904
Diffstat (limited to 'tests/functional/fileupload_remote_test.php')
-rw-r--r--tests/functional/fileupload_remote_test.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php
index 4754153cbf..a32c339afa 100644
--- a/tests/functional/fileupload_remote_test.php
+++ b/tests/functional/fileupload_remote_test.php
@@ -28,6 +28,9 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
/** @var \phpbb\request\request_interface */
protected $request;
+ /** @var string phpBB root path */
+ protected $phpbb_root_path;
+
public function setUp()
{
parent::setUp();
@@ -53,6 +56,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
$container->set('files.filespec', new \phpbb\files\filespec($this->filesystem, $this->language));
$this->factory = new \phpbb\files\factory($container);
$container->set('files.factory', $this->factory);
+ $this->phpbb_root_path = $phpbb_root_path;
}
public function tearDown()
@@ -65,7 +69,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_invalid_extension()
{
/** @var \phpbb\files\upload $upload */
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
$upload->set_error_prefix('')
->set_allowed_extensions(array('jpg'))
->set_max_filesize(100);
@@ -76,7 +80,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_empty_file()
{
/** @var \phpbb\files\upload $upload */
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
$upload->set_error_prefix('')
->set_allowed_extensions(array('jpg'))
->set_max_filesize(100);
@@ -87,7 +91,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_successful_upload()
{
/** @var \phpbb\files\upload $upload */
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
$upload->set_error_prefix('')
->set_allowed_extensions(array('gif'))
->set_max_filesize(1000);
@@ -99,7 +103,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_too_large()
{
/** @var \phpbb\files\upload $upload */
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
$upload->set_error_prefix('')
->set_allowed_extensions(array('gif'))
->set_max_filesize(100);