aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/notification_test.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-03-21 03:08:15 +0100
committerAndreas Fischer <bantu@phpbb.com>2013-03-22 22:16:24 +0100
commit69df6b49db73d1a475d0b410f38fb4efb56d7451 (patch)
tree70731005be9f0a3017fc7bc21638b86e40fe6b38 /tests/functional/notification_test.php
parent15aec0bbb24be10da850f78d85a3d10880c6f28a (diff)
downloadforums-69df6b49db73d1a475d0b410f38fb4efb56d7451.tar
forums-69df6b49db73d1a475d0b410f38fb4efb56d7451.tar.gz
forums-69df6b49db73d1a475d0b410f38fb4efb56d7451.tar.bz2
forums-69df6b49db73d1a475d0b410f38fb4efb56d7451.tar.xz
forums-69df6b49db73d1a475d0b410f38fb4efb56d7451.zip
[ticket/11460] Add test for whether post_email and topic_email are checked.
PHPBB3-11460
Diffstat (limited to 'tests/functional/notification_test.php')
-rw-r--r--tests/functional/notification_test.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php
new file mode 100644
index 0000000000..519fb8152b
--- /dev/null
+++ b/tests/functional/notification_test.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_notification_test extends phpbb_functional_test_case
+{
+ static public function user_subscription_data()
+ {
+ return array(
+ array('post_notification', true),
+ array('topic_notification', true),
+
+ // PHPBB3-11460
+ array('post_email', true),
+ array('topic_email', true),
+ );
+ }
+
+ /**
+ * @dataProvider user_subscription_data
+ */
+ public function test_user_subscriptions($checkbox_name, $expected_status)
+ {
+ $this->login();
+ $crawler = $this->request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
+ $this->assert_response_success();
+
+ $cplist = $crawler->filter('.cplist');
+ if ($expected_status)
+ {
+ $this->assert_checkbox_is_checked($cplist, $checkbox_name);
+ }
+ else
+ {
+ $this->assert_checkbox_is_unchecked($cplist, $checkbox_name);
+ }
+ }
+}