aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/common_avatar_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-08-07 17:19:08 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-08-07 17:29:33 +0200
commite0c2013bb921f04f032744c3bc351c015c759d8d (patch)
treedc9f79569e572646a0ec49e3e81119802701119e /tests/functional/common_avatar_test.php
parent4f23bb711ca457efba370d7ac67394e0db59b578 (diff)
downloadforums-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/common_avatar_test.php')
-rw-r--r--tests/functional/common_avatar_test.php15
1 files changed, 14 insertions, 1 deletions
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());
+ }
}
}