diff options
author | 3D-I <480857+3D-I@users.noreply.github.com> | 2019-10-28 21:11:42 +0100 |
---|---|---|
committer | 3D-I <480857+3D-I@users.noreply.github.com> | 2019-10-28 21:11:42 +0100 |
commit | d136a8a9078b02433f4be08420486ad05c8129bd (patch) | |
tree | 4d3c720253ed2edef075bec7152a0ce66db16e10 /tests/functional/plupload_test.php | |
parent | 41728f2258c409480b9c3d4c1753b6eb1b47c677 (diff) | |
parent | e95e387188b050c163edcce3141c957d259810c9 (diff) | |
download | forums-d136a8a9078b02433f4be08420486ad05c8129bd.tar forums-d136a8a9078b02433f4be08420486ad05c8129bd.tar.gz forums-d136a8a9078b02433f4be08420486ad05c8129bd.tar.bz2 forums-d136a8a9078b02433f4be08420486ad05c8129bd.tar.xz forums-d136a8a9078b02433f4be08420486ad05c8129bd.zip |
Merge branch '3.2.x' into ticket/16153
Diffstat (limited to 'tests/functional/plupload_test.php')
-rw-r--r-- | tests/functional/plupload_test.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php index 9d284a7e57..4ab1c8e9e5 100644 --- a/tests/functional/plupload_test.php +++ b/tests/functional/plupload_test.php @@ -76,6 +76,10 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case $chunk_size = ceil(filesize($this->path . 'valid.jpg') / self::CHUNKS); $handle = fopen($this->path . 'valid.jpg', 'rb'); + $crawler = self::$client->request('POST', $url . '&sid=' . $this->sid); + + $file_form_data = $this->get_hidden_fields($crawler, $url); + for ($i = 0; $i < self::CHUNKS; $i++) { $chunk = fread($handle, $chunk_size); @@ -94,13 +98,13 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case $crawler = self::$client->request( 'POST', $url . '&sid=' . $this->sid, - array( + array_merge(array( 'chunk' => $i, 'chunks' => self::CHUNKS, 'name' => md5('valid') . '.jpg', 'real_filename' => 'valid.jpg', 'add_file' => $this->lang('ADD_FILE'), - ), + ), $file_form_data), array('fileupload' => $file), array('X-PHPBB-USING-PLUPLOAD' => '1') ); @@ -134,17 +138,19 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case 'error' => UPLOAD_ERR_OK, ); + $file_form_data = $this->get_hidden_fields(null, $url); + self::$client->setServerParameter('HTTP_X_PHPBB_USING_PLUPLOAD', '1'); self::$client->request( 'POST', $url . '&sid=' . $this->sid, - array( + array_merge(array( 'chunk' => '0', 'chunks' => '1', 'name' => md5('valid') . '.jpg', 'real_filename' => 'valid.jpg', 'add_file' => $this->lang('ADD_FILE'), - ), + ), $file_form_data), array('fileupload' => $file) ); |