[ticket/develop/11568] Fix some more tests in 3.1

PHPBB3-11568
This commit is contained in:
Joas Schilling 2013-05-30 13:26:16 +02:00
parent 4f6b12ae1d
commit a36defb10f
3 changed files with 7 additions and 6 deletions

View file

@ -113,7 +113,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_missing_argument() public function test_missing_argument()
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = $this->request('GET', 'app.php?controller=foo/baz', false); $crawler = $this->request('GET', 'app.php?controller=foo/baz', array(), true);
$this->request('GET', 'app.php?controller=foo/baz', false); $this->request('GET', 'app.php?controller=foo/baz', false);
$this->assert_response_success(500); $this->assert_response_success(500);
$this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text()); $this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text());
@ -126,7 +126,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_exception_should_result_in_500_status_code() public function test_exception_should_result_in_500_status_code()
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = $this->request('GET', 'app.php?controller=foo/exception', false); $crawler = $this->request('GET', 'app.php?controller=foo/exception', array(), true);
$this->assert_response_success(500); $this->assert_response_success(500);
$this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text()); $this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar'); $this->phpbb_extension_manager->purge('foo/bar');
@ -143,7 +143,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
*/ */
public function test_error_ext_disabled_or_404() public function test_error_ext_disabled_or_404()
{ {
$crawler = $this->request('GET', 'app.php?controller=does/not/exist', false); $crawler = $this->request('GET', 'app.php?controller=does/not/exist', array(), true);
$this->assert_response_success(404); $this->assert_response_success(404);
$this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
} }

View file

@ -32,7 +32,7 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
'error' => UPLOAD_ERR_OK, 'error' => UPLOAD_ERR_OK,
); );
$crawler = $this->client->request( $crawler = self::$client->request(
'POST', 'POST',
'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid, 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid,
array('add_file' => $this->lang('ADD_FILE')), array('add_file' => $this->lang('ADD_FILE')),

View file

@ -58,7 +58,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_successful_upload() public function test_successful_upload()
{ {
$upload = new fileupload('', array('gif'), 1000); $upload = new fileupload('', array('gif'), 1000);
$file = $upload->remote_upload($this->root_url . 'styles/prosilver/theme/images/forum_read.gif'); $file = $upload->remote_upload(self::$root_url . 'styles/prosilver/theme/images/forum_read.gif');
$this->assertEquals(0, sizeof($file->error)); $this->assertEquals(0, sizeof($file->error));
$this->assertTrue(file_exists($file->filename)); $this->assertTrue(file_exists($file->filename));
} }
@ -66,7 +66,8 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_too_large() public function test_too_large()
{ {
$upload = new fileupload('', array('gif'), 100); $upload = new fileupload('', array('gif'), 100);
$file = $upload->remote_upload($this->root_url . 'styles/prosilver/theme/images/forum_read.gif'); $file = $upload->remote_upload(self::$root_url . 'styles/prosilver/theme/images/forum_read.gif');
$this->assertEquals(1, sizeof($file->error));
$this->assertEquals('WRONG_FILESIZE', $file->error[0]); $this->assertEquals('WRONG_FILESIZE', $file->error[0]);
} }
} }