aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/content_visibility/delete_post_test.php4
-rw-r--r--tests/functional/ucp_profile_test.php8
-rw-r--r--tests/profilefields/type_string_test.php12
3 files changed, 22 insertions, 2 deletions
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
index e0a2a3d402..99068729df 100644
--- a/tests/content_visibility/delete_post_test.php
+++ b/tests/content_visibility/delete_post_test.php
@@ -266,7 +266,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
*/
public function test_delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason, $expected_posts, $expected_topic, $expected_forum)
{
- global $auth, $cache, $config, $db, $phpbb_container, $phpbb_root_path, $phpEx;
+ global $auth, $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
$config['search_type'] = 'phpbb_mock_search';
$cache = new phpbb_mock_cache;
@@ -283,6 +283,8 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
)));
$user = $this->getMock('\phpbb\user');
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
diff --git a/tests/functional/ucp_profile_test.php b/tests/functional/ucp_profile_test.php
index fb8e1808f6..46b67ff843 100644
--- a/tests/functional/ucp_profile_test.php
+++ b/tests/functional/ucp_profile_test.php
@@ -25,15 +25,21 @@ class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
$this->assertContainsLang('UCP_PROFILE_PROFILE_INFO', $crawler->filter('#cp-main h2')->text());
$form = $crawler->selectButton('Submit')->form(array(
+ 'pf_phpbb_facebook' => 'phpbb',
'pf_phpbb_location' => 'Bertie´s Empire',
- 'pf_phpbb_skype' => 'phpbb.skype.account',
+ 'pf_phpbb_skype' => 'phpbb.skype.account',
+ 'pf_phpbb_twitter' => 'phpbb_twitter',
));
+
$crawler = self::submit($form);
$this->assertContainsLang('PROFILE_UPDATED', $crawler->filter('#message')->text());
$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
$form = $crawler->selectButton('Submit')->form();
+
+ $this->assertEquals('phpbb', $form->get('pf_phpbb_facebook')->getValue());
$this->assertEquals('Bertie´s Empire', $form->get('pf_phpbb_location')->getValue());
$this->assertEquals('phpbb.skype.account', $form->get('pf_phpbb_skype')->getValue());
+ $this->assertEquals('phpbb_twitter', $form->get('pf_phpbb_twitter')->getValue());
}
}
diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php
index 8db89bd709..cee8a1d863 100644
--- a/tests/profilefields/type_string_test.php
+++ b/tests/profilefields/type_string_test.php
@@ -144,6 +144,18 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case
'Required field should accept a characters only field',
),
array(
+ 'Valid.Username123',
+ array('field_validation' => '[\w.]+'),
+ false,
+ 'Required field should accept a alphanumeric field with dots',
+ ),
+ array(
+ 'Invalid.,username123',
+ array('field_validation' => '[\w.]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_DOTS-field',
+ 'Required field should reject field with comma',
+ ),
+ array(
'skype.test.name,_this',
array('field_validation' => '[a-zA-Z][\w\.,\-_]+'),
false,