aboutsummaryrefslogtreecommitdiffstats
path: root/tests/files
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-08-26 13:57:42 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-09-09 08:28:10 +0200
commitcdde86ce7e0c594fad5992789b3fae466bd526cc (patch)
treed5c07abb9173ff98a5e2b05938144bfb10a44383 /tests/files
parent02f94b7527298aad3bd15738676da872aa498039 (diff)
downloadforums-cdde86ce7e0c594fad5992789b3fae466bd526cc.tar
forums-cdde86ce7e0c594fad5992789b3fae466bd526cc.tar.gz
forums-cdde86ce7e0c594fad5992789b3fae466bd526cc.tar.bz2
forums-cdde86ce7e0c594fad5992789b3fae466bd526cc.tar.xz
forums-cdde86ce7e0c594fad5992789b3fae466bd526cc.zip
[ticket/13904] Use \phpbb\php\ini class for ini_get()
PHPBB3-13904
Diffstat (limited to 'tests/files')
-rw-r--r--tests/files/upload_test.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/files/upload_test.php b/tests/files/upload_test.php
index dc0080d25c..d11ebc742b 100644
--- a/tests/files/upload_test.php
+++ b/tests/files/upload_test.php
@@ -23,6 +23,9 @@ class phpbb_files_upload_test extends phpbb_test_case
/** @var \phpbb\files\factory */
protected $factory;
+ /** @var \phpbb\php\ini */
+ protected $php_ini;
+
/** @var \phpbb\language\language */
protected $language;
@@ -49,10 +52,12 @@ class phpbb_files_upload_test extends phpbb_test_case
$this->filesystem = new \phpbb\filesystem\filesystem();
$this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
+ $this->php_ini = new \phpbb\php\ini;
$this->container = new phpbb_mock_container_builder($phpbb_root_path, $phpEx);
$this->container->set('files.filespec', new \phpbb\files\filespec(
$this->filesystem,
+ $this->php_ini,
$this->language,
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
@@ -66,7 +71,7 @@ class phpbb_files_upload_test extends phpbb_test_case
public function test_reset_vars()
{
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $this->request, $this->phpbb_root_path);
$upload->set_max_filesize(500);
$this->assertEquals(500, $upload->max_filesize);
$upload->reset_vars();
@@ -75,7 +80,7 @@ class phpbb_files_upload_test extends phpbb_test_case
public function test_set_disallowed_content()
{
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $this->request, $this->phpbb_root_path);
$disallowed_content = new ReflectionProperty($upload, 'disallowed_content');
$disallowed_content->setAccessible(true);
@@ -93,7 +98,7 @@ class phpbb_files_upload_test extends phpbb_test_case
public function test_is_valid()
{
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $this->request, $this->phpbb_root_path);
$this->assertFalse($upload->is_valid('foobar'));
}
@@ -116,7 +121,7 @@ class phpbb_files_upload_test extends phpbb_test_case
*/
public function test_assign_internal_error($error_code, $expected)
{
- $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->request, $this->phpbb_root_path);
+ $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $this->request, $this->phpbb_root_path);
$this->assertSame($expected, $upload->assign_internal_error($error_code));
}
}