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

[ticket/13904] Switch around constructor arguments

PHPBB3-13904
This commit is contained in:
Marc Alexander
2015-08-26 16:18:10 +02:00
parent cdde86ce7e
commit 36545d5cbe
7 changed files with 36 additions and 44 deletions

View File

@@ -70,8 +70,8 @@ class phpbb_fileupload_test extends phpbb_test_case
$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,
$this->php_ini,
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),
@@ -116,7 +116,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_common_checks_invalid_extension()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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'))
->set_max_filesize(100);
$file = $this->gen_valid_filespec();
@@ -126,10 +126,10 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_common_checks_disallowed_content()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(1000);
$file = new \phpbb\files\filespec($this->filesystem, $this->php_ini, $this->language, $this->phpbb_root_path);
$file = new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, $this->phpbb_root_path);
$file->set_upload_ary(array(
'size' => 50,
'tmp_name' => dirname(__FILE__) . '/fixture/disallowed',
@@ -145,7 +145,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_common_checks_invalid_filename()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(100);
$file = $this->gen_valid_filespec();
@@ -156,7 +156,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_common_checks_too_large()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(100);
$file = $this->gen_valid_filespec();
@@ -167,7 +167,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_common_checks_valid_file()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(1000);
$file = $this->gen_valid_filespec();
@@ -177,7 +177,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_local_upload()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(1000);
@@ -191,7 +191,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_move_existent_file()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(1000);
@@ -205,7 +205,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_move_existent_file_overwrite()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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('jpg'))
->set_max_filesize(1000);
@@ -220,7 +220,7 @@ class phpbb_fileupload_test extends phpbb_test_case
public function test_valid_dimensions()
{
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->php_ini, $this->language, $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(false)
->set_max_filesize(false)
->set_allowed_dimensions(1, 1, 100, 100);