[ticket/develop/11568] Remove unneccessary calls to assert_response_success()

PHPBB3-11568
This commit is contained in:
Joas Schilling 2013-05-28 14:58:40 +02:00
parent 467c4d62c4
commit f1523944a0
9 changed files with 2 additions and 26 deletions

View file

@ -26,7 +26,6 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
// Permissions tab // Permissions tab
// XXX hardcoded id // XXX hardcoded id
$crawler = $this->request('GET', 'adm/index.php?i=16&sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?i=16&sid=' . $this->sid);
$this->assert_response_success();
// these language strings are html // these language strings are html
$this->assertContains($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content()); $this->assertContains($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content());
} }
@ -35,7 +34,6 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
{ {
// User permissions // User permissions
$crawler = $this->request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
$this->assert_response_success();
$this->assertContains($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content()); $this->assertContains($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content());
// Select admin // Select admin
@ -43,7 +41,6 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$data = array('username[0]' => 'admin'); $data = array('username[0]' => 'admin');
$form->setValues($data); $form->setValues($data);
$crawler = $this->submit($form); $crawler = $this->submit($form);
$this->assert_response_success();
$this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
} }
@ -92,7 +89,6 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
{ {
// Get the form // Get the form
$crawler = $this->request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid); $crawler = $this->request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid);
$this->assert_response_success();
$this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
// XXX globals for phpbb_auth, refactor it later // XXX globals for phpbb_auth, refactor it later
@ -115,7 +111,6 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$data = array("setting[$object_id][0][$permission]" => '0'); $data = array("setting[$object_id][0][$permission]" => '0');
$form->setValues($data); $form->setValues($data);
$crawler = $this->submit($form); $crawler = $this->submit($form);
$this->assert_response_success();
$this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text()); $this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text());
// check acl again // check acl again

View file

@ -53,7 +53,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
// check that we are logged in // check that we are logged in
$crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid);
$this->assert_response_success();
$this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text()); $this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
} }
} }

View file

@ -91,7 +91,6 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = $this->request('GET', 'app.php?controller=foo/bar'); $crawler = $this->request('GET', 'app.php?controller=foo/bar');
$this->assert_response_success();
$this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text()); $this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar'); $this->phpbb_extension_manager->purge('foo/bar');
} }
@ -103,7 +102,6 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = $this->request('GET', 'app.php?controller=foo/template'); $crawler = $this->request('GET', 'app.php?controller=foo/template');
$this->assert_response_success();
$this->assertContains("I am a variable", $crawler->filter('#content')->text()); $this->assertContains("I am a variable", $crawler->filter('#content')->text());
$this->phpbb_extension_manager->purge('foo/bar'); $this->phpbb_extension_manager->purge('foo/bar');
} }
@ -128,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'); $crawler = $this->request('GET', 'app.php?controller=foo/exception', false);
$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');
@ -145,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'); $crawler = $this->request('GET', 'app.php?controller=does/not/exist', false);
$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

@ -100,14 +100,12 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
// User permissions // User permissions
$crawler = $this->request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
$this->assert_response_success();
// Select admin // Select admin
$form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
$data = array('username[0]' => 'admin'); $data = array('username[0]' => 'admin');
$form->setValues($data); $form->setValues($data);
$crawler = $this->submit($form); $crawler = $this->submit($form);
$this->assert_response_success();
// language from language/en/acp/permissions_phpbb.php // language from language/en/acp/permissions_phpbb.php
$this->assertContains('Can attach files', $crawler->filter('body')->text()); $this->assertContains('Can attach files', $crawler->filter('body')->text());

View file

@ -66,7 +66,6 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
{ {
$this->markTestIncomplete('Test fails intermittently.'); $this->markTestIncomplete('Test fails intermittently.');
$crawler = $this->upload_file('valid.jpg', 'image/jpeg'); $crawler = $this->upload_file('valid.jpg', 'image/jpeg');
$this->assert_response_success();
// ensure there was no error message rendered // ensure there was no error message rendered
$this->assertNotContains('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->get_content()); $this->assertNotContains('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->get_content());
$this->assertContains($this->lang('POSTED_ATTACHMENTS'), $crawler->filter('#postform h3')->eq(1)->text()); $this->assertContains($this->lang('POSTED_ATTACHMENTS'), $crawler->filter('#postform h3')->eq(1)->text());

View file

@ -17,7 +17,6 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
global $config; global $config;
$this->add_lang('ucp'); $this->add_lang('ucp');
$crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); $crawler = $this->request('GET', 'ucp.php?mode=sendpassword');
$this->assert_response_success();
$this->assertEquals($this->lang('SEND_PASSWORD'), $crawler->filter('h2')->text()); $this->assertEquals($this->lang('SEND_PASSWORD'), $crawler->filter('h2')->text());
} }
@ -38,7 +37,6 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
$this->logout(); $this->logout();
$crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); $crawler = $this->request('GET', 'ucp.php?mode=sendpassword');
$this->assert_response_success();
$this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text()); $this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text());
} }

View file

@ -18,17 +18,14 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
// logs in as admin // logs in as admin
$this->login(); $this->login();
$crawler = $this->request('GET', 'memberlist.php?sid=' . $this->sid); $crawler = $this->request('GET', 'memberlist.php?sid=' . $this->sid);
$this->assert_response_success();
$this->assertContains('memberlist-test-user', $crawler->text()); $this->assertContains('memberlist-test-user', $crawler->text());
// restrict by first character // restrict by first character
$crawler = $this->request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid); $crawler = $this->request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid);
$this->assert_response_success();
$this->assertContains('memberlist-test-user', $crawler->text()); $this->assertContains('memberlist-test-user', $crawler->text());
// make sure results for wrong character are not returned // make sure results for wrong character are not returned
$crawler = $this->request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid); $crawler = $this->request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid);
$this->assert_response_success();
$this->assertNotContains('memberlist-test-user', $crawler->text()); $this->assertNotContains('memberlist-test-user', $crawler->text());
} }
@ -37,15 +34,12 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
$this->login(); $this->login();
// XXX hardcoded user id // XXX hardcoded user id
$crawler = $this->request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid); $crawler = $this->request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid);
$this->assert_response_success();
$this->assertContains('admin', $crawler->filter('h2')->text()); $this->assertContains('admin', $crawler->filter('h2')->text());
} }
protected function get_memberlist_leaders_table_crawler() protected function get_memberlist_leaders_table_crawler()
{ {
$crawler = $this->request('GET', 'memberlist.php?mode=leaders&sid=' . $this->sid); $crawler = $this->request('GET', 'memberlist.php?mode=leaders&sid=' . $this->sid);
$this->assert_response_success();
return $crawler->filter('.forumbg-table'); return $crawler->filter('.forumbg-table');
} }

View file

@ -76,8 +76,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
public function test_extensions_list() public function test_extensions_list()
{ {
$crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid);
$this->assert_response_success();
$this->assertContains($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text()); $this->assertContains($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text());
$this->assertContains('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text()); $this->assertContains('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text());
$this->assertContains('Details', $crawler->filter('#main')->text()); $this->assertContains('Details', $crawler->filter('#main')->text());
@ -86,7 +84,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
public function test_extensions_details() public function test_extensions_details()
{ {
$crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo%2Fbar&sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo%2Fbar&sid=' . $this->sid);
$this->assert_response_success();
// Test whether the details are displayed // Test whether the details are displayed
$this->assertContains($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text()); $this->assertContains($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text());
@ -103,7 +100,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
public function test_extensions_details_notexists() public function test_extensions_details_notexists()
{ {
$crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=not%2Fexists&sid=' . $this->sid); $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=not%2Fexists&sid=' . $this->sid);
$this->assert_response_success();
// Error message because the files do not exist // Error message because the files do not exist
$this->assertContains('The required file does not exist:', $crawler->filter('#main')->text()); $this->assertContains('The required file does not exist:', $crawler->filter('#main')->text());

View file

@ -41,7 +41,6 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
{ {
$this->login(); $this->login();
$crawler = $this->request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options'); $crawler = $this->request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
$this->assert_response_success();
$cplist = $crawler->filter('.table1'); $cplist = $crawler->filter('.table1');
if ($expected_status) if ($expected_status)