1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-16 13:44:12 +02:00

[ticket/16346] Fix method arguments

PHPBB3-16346
This commit is contained in:
rubencm
2020-08-14 18:42:50 +00:00
parent 758c28ca69
commit 490ddbc2cd
46 changed files with 78 additions and 144 deletions

View File

@@ -31,9 +31,6 @@ class phpbb_files_upload_test extends phpbb_test_case
/** @var \phpbb\request\request_interface */
protected $request;
/** @var string phpBB root path */
protected $phpbb_root_path;
protected function setUp(): void
{
// Global $config required by unique_id
@@ -53,7 +50,7 @@ class phpbb_files_upload_test extends phpbb_test_case
$this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
$this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper;
$this->container = new phpbb_mock_container_builder($phpbb_root_path, $phpEx);
$this->container = new phpbb_mock_container_builder();
$this->container->set('files.filespec', new \phpbb\files\filespec(
$this->filesystem,
$this->language,
@@ -64,13 +61,11 @@ class phpbb_files_upload_test extends phpbb_test_case
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),
))));
$this->factory = new \phpbb\files\factory($this->container);
$this->phpbb_root_path = $phpbb_root_path;
}
public function test_reset_vars()
{
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request);
$upload->set_max_filesize(500);
$this->assertEquals(500, $upload->max_filesize);
$upload->reset_vars();
@@ -79,7 +74,7 @@ class phpbb_files_upload_test extends phpbb_test_case
public function test_set_disallowed_content()
{
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request);
$disallowed_content = new ReflectionProperty($upload, 'disallowed_content');
$disallowed_content->setAccessible(true);
@@ -97,7 +92,7 @@ class phpbb_files_upload_test extends phpbb_test_case
public function test_is_valid()
{
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request);
$this->assertFalse($upload->is_valid('foobar'));
}
@@ -120,7 +115,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->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request);
$this->assertSame($expected, $upload->assign_internal_error($error_code));
}
}