aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/avatar_acp_groups_test.php2
-rw-r--r--tests/functional/avatar_acp_users_test.php2
-rw-r--r--tests/functional/avatar_ucp_groups_test.php2
-rw-r--r--tests/functional/avatar_ucp_users_test.php13
-rw-r--r--tests/functional/common_avatar_test.php15
-rw-r--r--tests/functional/download_test.php64
-rw-r--r--tests/functional/fileupload_form_test.php2
-rw-r--r--tests/functional/fileupload_remote_test.php2
-rw-r--r--tests/functional/forgot_password_test.php2
-rw-r--r--tests/functional/plupload_test.php2
10 files changed, 19 insertions, 87 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 62cd79c307..972bfa0fb2 100644
--- a/tests/functional/avatar_ucp_users_test.php
+++ b/tests/functional/avatar_ucp_users_test.php
@@ -36,18 +36,9 @@ class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_ava
'avatar_gravatar_height' => 80,
),
),
- // Wrong driver selected
- array(
- 'NO_AVATAR_SELECTED',
- 'avatar_driver_upload',
- array(
- 'avatar_remote_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
- 'avatar_remote_width' => 80,
- 'avatar_remote_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());
+ }
}
}
diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php
index 6a6df14c81..4e4995c21e 100644
--- a/tests/functional/download_test.php
+++ b/tests/functional/download_test.php
@@ -80,20 +80,6 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
'attachments' => true,
));
- // Download topic archive as guest
- $crawler = self::request('GET', "download/file.php?archive=.zip&topic_id={$this->data['topics']['Download Topic #1']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
- // Download post archive as guest
- $crawler = self::request('GET', "download/file.php?archive=.zip&post_id={$this->data['posts']['Re: Download Topic #1-#2']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
// Download attachment as guest
$crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
self::assert_response_status_code(200);
@@ -147,18 +133,6 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
));
$this->add_lang('viewtopic');
- // Download topic archive as guest: still works
- $crawler = self::request('GET', "download/file.php?archive=.zip&topic_id={$this->data['topics']['Download Topic #1']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
- // No download post archive as guest
- $crawler = self::request('GET', "download/file.php?archive=.zip&post_id={$this->data['posts']['Re: Download Topic #1-#2']}", array(), false);
- self::assert_response_html(404);
- $this->assertContainsLang('ERROR_NO_ATTACHMENT', $crawler->filter('#message')->text());
-
// No download attachment as guest
$crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
self::assert_response_html(404);
@@ -167,20 +141,6 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
// Login as admin and try again, should work now.
$this->login();
- // Download topic archive as admin
- $crawler = self::request('GET', "download/file.php?archive=.zip&topic_id={$this->data['topics']['Download Topic #1']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
- // Download post archive as admin
- $crawler = self::request('GET', "download/file.php?archive=.zip&post_id={$this->data['posts']['Re: Download Topic #1-#2']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
// Download attachment as admin
$crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
self::assert_response_status_code(200);
@@ -235,16 +195,6 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
));
$this->add_lang('viewtopic');
- // Download topic archive as guest: still works
- $crawler = self::request('GET', "download/file.php?archive=.zip&topic_id={$this->data['topics']['Download Topic #1']}", array(), false);
- self::assert_response_html(404);
- $this->assertContainsLang('ERROR_NO_ATTACHMENT', $crawler->filter('#message')->text());
-
- // No download post archive as guest
- $crawler = self::request('GET', "download/file.php?archive=.zip&post_id={$this->data['posts']['Re: Download Topic #1-#2']}", array(), false);
- self::assert_response_html(404);
- $this->assertContainsLang('ERROR_NO_ATTACHMENT', $crawler->filter('#message')->text());
-
// No download attachment as guest
$crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
self::assert_response_html(404);
@@ -253,20 +203,6 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
// Login as admin and try again, should work now.
$this->login();
- // Download topic archive as admin
- $crawler = self::request('GET', "download/file.php?archive=.zip&topic_id={$this->data['topics']['Download Topic #1']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
- // Download post archive as admin
- $crawler = self::request('GET', "download/file.php?archive=.zip&post_id={$this->data['posts']['Re: Download Topic #1-#2']}", array(), false);
- self::assert_response_status_code(200);
- $content = self::$client->getResponse()->getContent();
- $finfo = new finfo(FILEINFO_MIME_TYPE);
- self::assertEquals('application/zip', $finfo->buffer($content));
-
// Download attachment as admin
$crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
self::assert_response_status_code(200);
diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php
index 29036c821e..e87953367f 100644
--- a/tests/functional/fileupload_form_test.php
+++ b/tests/functional/fileupload_form_test.php
@@ -42,8 +42,6 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
unlink($fileinfo->getPathname());
}
-
- parent::tearDown();
}
private function upload_file($filename, $mimetype)
diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php
index ef39e1d71b..6ece150b23 100644
--- a/tests/functional/fileupload_remote_test.php
+++ b/tests/functional/fileupload_remote_test.php
@@ -45,8 +45,6 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
global $config, $user;
$user = null;
$config = array();
-
- parent::tearDown();
}
public function test_invalid_extension()
diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php
index c95efc5b2e..64fa19557f 100644
--- a/tests/functional/forgot_password_test.php
+++ b/tests/functional/forgot_password_test.php
@@ -57,7 +57,5 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
'config[allow_password_reset]' => 1,
));
$crawler = self::submit($form);
-
- parent::tearDown();
}
}
diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php
index d9faec035c..ee71597ffc 100644
--- a/tests/functional/plupload_test.php
+++ b/tests/functional/plupload_test.php
@@ -57,8 +57,6 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case
unlink($fileinfo->getPathname());
}
-
- parent::tearDown();
}
public function get_urls()