1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[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
This commit is contained in:
Marc Alexander
2014-08-07 17:19:08 +02:00
parent 4f23bb711c
commit e0c2013bb9
14 changed files with 224 additions and 93 deletions

View File

@@ -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());
}
}
}