diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-09-09 12:58:22 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-09-09 12:58:22 +0200 |
commit | 40e614f56436447dffd272351e23b79c2da9fa3f (patch) | |
tree | fc534b430576dd978d3a13c5b2f3e1ca13c33056 | |
parent | 5f91f1cad85eaf7f8dc62a1a140605a46431496f (diff) | |
download | forums-40e614f56436447dffd272351e23b79c2da9fa3f.tar forums-40e614f56436447dffd272351e23b79c2da9fa3f.tar.gz forums-40e614f56436447dffd272351e23b79c2da9fa3f.tar.bz2 forums-40e614f56436447dffd272351e23b79c2da9fa3f.tar.xz forums-40e614f56436447dffd272351e23b79c2da9fa3f.zip |
[ticket/13904] Fix tests after changes to factory
PHPBB3-13904
-rw-r--r-- | phpBB/includes/functions_posting.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/upload.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/files/upload.php | 2 | ||||
-rw-r--r-- | tests/functional/fileupload_remote_test.php | 8 | ||||
-rw-r--r-- | tests/upload/fileupload_test.php | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 378d14d14d..cd7c9a82f7 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -433,7 +433,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); /** @var \phpbb\files\filespec $file */ - $file = ($local) ? $upload->handle_upload('local', $local_storage, $local_filedata) : $upload->handle_upload('form', $form_name); + $file = ($local) ? $upload->handle_upload('files.types.local', $local_storage, $local_filedata) : $upload->handle_upload('files.types.form', $form_name); if ($file->init_error()) { diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index 2bd23a26a8..a0c23cb624 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -116,7 +116,7 @@ class upload extends \phpbb\avatar\driver\driver if (!empty($upload_file['name'])) { - $file = $upload->handle_upload('form', 'avatar_upload_file'); + $file = $upload->handle_upload('files.types.form', 'avatar_upload_file'); } else if (!empty($this->config['allow_avatar_remote_upload']) && !empty($url)) { @@ -146,7 +146,7 @@ class upload extends \phpbb\avatar\driver\driver return false; } - $file = $upload->handle_upload('remote', $url); + $file = $upload->handle_upload('files.types.remote', $url); } else { diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php index 45ff1c372f..e011e714e5 100644 --- a/phpBB/phpbb/files/upload.php +++ b/phpBB/phpbb/files/upload.php @@ -197,7 +197,7 @@ class upload { $args = func_get_args(); array_shift($args); - $type_class = $this->factory->get('types.' . $type) + $type_class = $this->factory->get($type) ->set_upload($this); return (is_object($type_class)) ? call_user_func_array(array($type_class, 'upload'), $args) : false; diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php index 3349ffc576..7e0f192b40 100644 --- a/tests/functional/fileupload_remote_test.php +++ b/tests/functional/fileupload_remote_test.php @@ -78,7 +78,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $upload->set_error_prefix('') ->set_allowed_extensions(array('jpg')) ->set_max_filesize(100); - $file = $upload->handle_upload('remote', self::$root_url . 'develop/blank.gif'); + $file = $upload->handle_upload('files.types.remote', self::$root_url . 'develop/blank.gif'); $this->assertEquals('URL_INVALID', $file->error[0]); } @@ -89,7 +89,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $upload->set_error_prefix('') ->set_allowed_extensions(array('jpg')) ->set_max_filesize(100); - $file = $upload->handle_upload('remote', self::$root_url . 'develop/blank.jpg'); + $file = $upload->handle_upload('files.types.remote', self::$root_url . 'develop/blank.jpg'); $this->assertEquals('EMPTY_REMOTE_DATA', $file->error[0]); } @@ -100,7 +100,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $upload->set_error_prefix('') ->set_allowed_extensions(array('gif')) ->set_max_filesize(1000); - $file = $upload->handle_upload('remote', self::$root_url . 'styles/prosilver/theme/images/forum_read.gif'); + $file = $upload->handle_upload('files.types.remote', self::$root_url . 'styles/prosilver/theme/images/forum_read.gif'); $this->assertEquals(0, sizeof($file->error)); $this->assertTrue(file_exists($file->get('filename'))); $this->assertTrue($file->is_uploaded()); @@ -113,7 +113,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $upload->set_error_prefix('') ->set_allowed_extensions(array('gif')) ->set_max_filesize(100); - $file = $upload->handle_upload('remote', self::$root_url . 'styles/prosilver/theme/images/forum_read.gif'); + $file = $upload->handle_upload('files.types.remote', self::$root_url . 'styles/prosilver/theme/images/forum_read.gif'); $this->assertEquals(1, sizeof($file->error)); $this->assertEquals('WRONG_FILESIZE', $file->error[0]); } diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php index 01b625efbb..211e72a6e9 100644 --- a/tests/upload/fileupload_test.php +++ b/tests/upload/fileupload_test.php @@ -185,7 +185,7 @@ class phpbb_fileupload_test extends phpbb_test_case ->set_max_filesize(1000); copy($this->path . 'jpg', $this->path . 'jpg.jpg'); - $file = $upload->handle_upload('local', $this->path . 'jpg.jpg'); + $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg'); $this->assertEquals(0, sizeof($file->error)); $this->assertFalse($file->additional_checks()); $this->assertTrue($file->move_file('../tests/upload/fixture/copies', true)); @@ -199,7 +199,7 @@ class phpbb_fileupload_test extends phpbb_test_case ->set_max_filesize(1000); copy($this->path . 'jpg', $this->path . 'jpg.jpg'); - $file = $upload->handle_upload('local', $this->path . 'jpg.jpg'); + $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg'); $this->assertEquals(0, sizeof($file->error)); $this->assertFalse($file->move_file('../tests/upload/fixture')); $this->assertFalse($file->file_moved); @@ -214,7 +214,7 @@ class phpbb_fileupload_test extends phpbb_test_case copy($this->path . 'jpg', $this->path . 'jpg.jpg'); copy($this->path . 'jpg', $this->path . 'copies/jpg.jpg'); - $file = $upload->handle_upload('local', $this->path . 'jpg.jpg'); + $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg'); $this->assertEquals(0, sizeof($file->error)); $file->move_file('../tests/upload/fixture/copies', true); $this->assertEquals(0, sizeof($file->error)); |