diff options
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/fileupload_remote_test.php | 5 | ||||
-rw-r--r-- | tests/functional/plupload_test.php | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php index 7e0f192b40..b70d49cddd 100644 --- a/tests/functional/fileupload_remote_test.php +++ b/tests/functional/fileupload_remote_test.php @@ -45,11 +45,12 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case if (!is_array($config)) { - $config = array(); + $config = new \phpbb\config\config(array()); } $config['rand_seed'] = ''; $config['rand_seed_last_update'] = time() + 600; + $config['remote_upload_verify'] = 0; $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); @@ -60,7 +61,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $container->set('files.filespec', new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \FastImageSize\FastImageSize(), $this->phpbb_root_path)); $this->factory = new \phpbb\files\factory($container); $container->set('files.factory', $this->factory); - $container->set('files.types.remote', new \phpbb\files\types\remote($this->factory, $this->language, $this->php_ini, $this->request, $phpbb_root_path)); + $container->set('files.types.remote', new \phpbb\files\types\remote($config, $this->factory, $this->language, $this->php_ini, $this->request, $phpbb_root_path)); $this->phpbb_root_path = $phpbb_root_path; } diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php index d358681ad1..9d284a7e57 100644 --- a/tests/functional/plupload_test.php +++ b/tests/functional/plupload_test.php @@ -107,11 +107,11 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case if ($i < self::CHUNKS - 1) { - $this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::$client->getResponse()->getContent()); + $this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::get_content()); } else { - $response = json_decode(self::$client->getResponse()->getContent(), true); + $response = json_decode(self::get_content(), true); $this->assertEquals('valid.jpg', $response['data'][0]['real_filename']); } @@ -134,7 +134,8 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case 'error' => UPLOAD_ERR_OK, ); - $crawler = self::$client->request( + self::$client->setServerParameter('HTTP_X_PHPBB_USING_PLUPLOAD', '1'); + self::$client->request( 'POST', $url . '&sid=' . $this->sid, array( @@ -144,11 +145,10 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case 'real_filename' => 'valid.jpg', 'add_file' => $this->lang('ADD_FILE'), ), - array('fileupload' => $file), - array('X-PHPBB-USING-PLUPLOAD' => '1') + array('fileupload' => $file) ); - $response = json_decode(self::$client->getResponse()->getContent(), true); + $response = json_decode(self::get_content(), true); $this->assertEquals('valid.jpg', $response['data'][0]['real_filename']); } } |