aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/registration_test.php16
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php10
2 files changed, 18 insertions, 8 deletions
diff --git a/tests/functional/registration_test.php b/tests/functional/registration_test.php
index 45a684db19..26473c4fcd 100644
--- a/tests/functional/registration_test.php
+++ b/tests/functional/registration_test.php
@@ -45,12 +45,24 @@ class phpbb_functional_registration_test extends phpbb_functional_test_case
$form = $crawler->selectButton('Submit')->form(array(
'username' => 'user-reg-test',
'email' => 'user-reg-test@phpbb.com',
- 'new_password' => 'testtest',
- 'password_confirm' => 'testtest',
+ 'new_password' => 'user-reg-testuser-reg-test',
+ 'password_confirm' => 'user-reg-testuser-reg-test',
));
$form['tz']->select('Europe/Berlin');
$crawler = self::submit($form);
$this->assertContainsLang('ACCOUNT_ADDED', $crawler->filter('#message')->text());
}
+
+ /**
+ * @depends test_register_new_account
+ */
+ public function test_default_subscription_options()
+ {
+ $this->login('user-reg-test');
+ $crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options&sid=' . $this->sid);
+ $form_values = $crawler->selectButton('Submit')->form()->getValues();
+ $this->assertEquals(1, $form_values['notification.type.post_notification.method.email']);
+ $this->assertEquals(1, $form_values['notification.type.topic_notification.method.email']);
+ }
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 49cc72363e..840ff981cb 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -556,12 +556,10 @@ class phpbb_functional_test_case extends phpbb_test_case
$cache = new phpbb_mock_null_cache;
$cache_driver = new \phpbb\cache\driver\null();
- $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $phpbb_container
- ->expects($this->any())
- ->method('get')
- ->with('cache.driver')
- ->will($this->returnValue($cache_driver));
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('cache.driver', $cache_driver);
+ $phpbb_notifications = new phpbb_mock_notification_manager();
+ $phpbb_container->set('notification_manager', $phpbb_notifications);
if (!function_exists('utf_clean_string'))
{