2013-03-21 03:08:15 +01:00
|
|
|
<?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(
|
2013-03-24 23:42:13 +01:00
|
|
|
// Rows inserted by phpBB/install/schemas/schema_data.sql
|
|
|
|
// Also see PHPBB3-11460
|
2013-03-21 03:08:15 +01:00
|
|
|
array('post_notification', true),
|
|
|
|
array('topic_notification', true),
|
|
|
|
array('post_email', true),
|
|
|
|
array('topic_email', true),
|
2013-03-24 23:42:13 +01:00
|
|
|
|
|
|
|
// Default behaviour for in-board notifications:
|
|
|
|
// If user did not opt-out, in-board notifications are on.
|
|
|
|
array('bookmark_notification', true),
|
|
|
|
array('quote_notification', true),
|
|
|
|
|
|
|
|
// Default behaviour for email notifications:
|
|
|
|
// If user did not opt-in, email notifications are off.
|
|
|
|
array('bookmark_email', false),
|
|
|
|
array('quote_email', false),
|
2013-03-21 03:08:15 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider user_subscription_data
|
|
|
|
*/
|
|
|
|
public function test_user_subscriptions($checkbox_name, $expected_status)
|
|
|
|
{
|
|
|
|
$this->login();
|
2013-05-31 16:45:06 +02:00
|
|
|
$crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
|
2013-03-21 03:08:15 +01:00
|
|
|
|
2013-05-11 23:33:40 +03:00
|
|
|
$cplist = $crawler->filter('.table1');
|
2013-03-21 03:08:15 +01:00
|
|
|
if ($expected_status)
|
|
|
|
{
|
|
|
|
$this->assert_checkbox_is_checked($cplist, $checkbox_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$this->assert_checkbox_is_unchecked($cplist, $checkbox_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|