diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-08-07 17:19:08 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-08-07 17:29:33 +0200 |
commit | e0c2013bb921f04f032744c3bc351c015c759d8d (patch) | |
tree | dc9f79569e572646a0ec49e3e81119802701119e /tests/functional | |
parent | 4f23bb711ca457efba370d7ac67394e0db59b578 (diff) | |
download | forums-e0c2013bb921f04f032744c3bc351c015c759d8d.tar forums-e0c2013bb921f04f032744c3bc351c015c759d8d.tar.gz forums-e0c2013bb921f04f032744c3bc351c015c759d8d.tar.bz2 forums-e0c2013bb921f04f032744c3bc351c015c759d8d.tar.xz forums-e0c2013bb921f04f032744c3bc351c015c759d8d.zip |
[ticket/12822] Add method for deleting avatars and use confirm_box
The method will take care of the actual deletion process in the avatar manager.
Additionally, we'll be using a confirm box while deleting the avatar to prevent
users from accidentally deleting their avatars.
PHPBB3-12822
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/avatar_acp_groups_test.php | 2 | ||||
-rw-r--r-- | tests/functional/avatar_acp_users_test.php | 2 | ||||
-rw-r--r-- | tests/functional/avatar_ucp_groups_test.php | 2 | ||||
-rw-r--r-- | tests/functional/avatar_ucp_users_test.php | 3 | ||||
-rw-r--r-- | tests/functional/common_avatar_test.php | 15 |
5 files changed, 19 insertions, 5 deletions
diff --git a/tests/functional/avatar_acp_groups_test.php b/tests/functional/avatar_acp_groups_test.php index 35f7956252..925335a2f7 100644 --- a/tests/functional/avatar_acp_groups_test.php +++ b/tests/functional/avatar_acp_groups_test.php @@ -48,7 +48,7 @@ class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_av ), // Delete avatar image to reset group settings array( - 'GROUP_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'GROUP_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/avatar_acp_users_test.php b/tests/functional/avatar_acp_users_test.php index 38e001f516..5eca473157 100644 --- a/tests/functional/avatar_acp_users_test.php +++ b/tests/functional/avatar_acp_users_test.php @@ -46,7 +46,7 @@ class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_ava ), // Reset avatar settings array( - 'USER_AVATAR_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'USER_AVATAR_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/avatar_ucp_groups_test.php b/tests/functional/avatar_ucp_groups_test.php index fddf66933f..1e8ca911c6 100644 --- a/tests/functional/avatar_ucp_groups_test.php +++ b/tests/functional/avatar_ucp_groups_test.php @@ -55,7 +55,7 @@ class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_av ), ), array( - 'GROUP_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'GROUP_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/avatar_ucp_users_test.php b/tests/functional/avatar_ucp_users_test.php index 09edde8dba..972bfa0fb2 100644 --- a/tests/functional/avatar_ucp_users_test.php +++ b/tests/functional/avatar_ucp_users_test.php @@ -36,8 +36,9 @@ class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_ava 'avatar_gravatar_height' => 80, ), ), + array( - 'PROFILE_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'PROFILE_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/common_avatar_test.php b/tests/functional/common_avatar_test.php index 1bb9e5cd8e..82d7136c98 100644 --- a/tests/functional/common_avatar_test.php +++ b/tests/functional/common_avatar_test.php @@ -50,7 +50,7 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test $this->assertContainsLang('CONFIG_UPDATED', $crawler->text()); } - public function assert_avatar_submit($expected, $type, $data, $button_text = 'SUBMIT') + public function assert_avatar_submit($expected, $type, $data, $delete = false, $button_text = 'SUBMIT') { $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid); @@ -72,6 +72,12 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test $crawler = self::submit($form); + if (is_array($expected)) + { + $delete_expected = $expected[1]; + $expected = $expected[0]; + } + try { $this->assertContainsLang($expected, $crawler->text()); @@ -80,5 +86,12 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test { $this->assertContains($expected, $crawler->text()); } + + if ($delete) + { + $form = $crawler->selectButton('confirm')->form(); + $crawler = self::submit($form); + $this->assertContainsLang($delete_expected, $crawler->text()); + } } } |