From 2a7a06da2a166b814732bdfa790e53b80da8a612 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Mon, 25 May 2015 20:54:30 +0200 Subject: [ticket/13847] Updated ucp_pm_compose to use the utils service ...when quoting a post PHPBB3-13847 --- tests/functional/private_messages_test.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index 1f6dc3a979..4851fc4c64 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -66,4 +66,18 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $crawler = self::submit($form); $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); } + + public function test_quote() + { + $text = 'Test post'; + $expected = '[quote="admin"]' . $text . '[/quote]'; + + $this->login(); + $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic'); + $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text); + + $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quotepost&p=' . $post['post_id'] . '&sid=' . $this->sid); + + $this->assertContains($expected, $crawler->filter('textarea#message')->text()); + } } -- cgit v1.2.1 From 64e1824abdb2a9c860e049f10ecc81c051160ff5 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Mon, 25 May 2015 21:04:12 +0200 Subject: [ticket/13847] Updated ucp_pm_compose to use utils when forwarding PHPBB3-13847 --- tests/functional/private_messages_test.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index 4851fc4c64..3f602d62fb 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -67,7 +67,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); } - public function test_quote() + public function test_quote_post() { $text = 'Test post'; $expected = '[quote="admin"]' . $text . '[/quote]'; @@ -80,4 +80,17 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $this->assertContains($expected, $crawler->filter('textarea#message')->text()); } + + public function test_quote_forward() + { + $text = 'This is a test private message sent by the testing framework.'; + $expected = '[quote="admin"]' . $text . '[/quote]'; + + $this->login(); + $message_id = $this->create_private_message('Test', $text, array(2)); + + $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=forward&f=0&p=' . $message_id . '&sid=' . $this->sid); + + $this->assertContains($expected, $crawler->filter('textarea#message')->text()); + } } -- cgit v1.2.1 From 433021f429f22dfd6d5dfc16c11195b19a488161 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sat, 30 May 2015 23:51:09 +0200 Subject: [ticket/13901] Fixed test's expected result PHPBB3-13901 --- tests/functional/private_messages_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index 3f602d62fb..be584c20c1 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -84,7 +84,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_forward() { $text = 'This is a test private message sent by the testing framework.'; - $expected = '[quote="admin"]' . $text . '[/quote]'; + $expected = "[quote=\"admin\"]\n" . $text . "\n[/quote]"; $this->login(); $message_id = $this->create_private_message('Test', $text, array(2)); -- cgit v1.2.1 From f02cc27014c27acaf44b27066959426db27b3493 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 16 Jun 2015 08:16:56 +0200 Subject: [ticket/10620] Implemented quote improvements PHPBB3-10620 --- tests/functional/private_messages_test.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index be584c20c1..9bfb5bc7ad 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -69,16 +69,30 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_post() { - $text = 'Test post'; - $expected = '[quote="admin"]' . $text . '[/quote]'; + $text = 'Test post'; $this->login(); $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic'); $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text); + $expected = '(\\[quote="admin" post_id="' . $post['post_id'] . '" time="\\d+" user_id="2"\\]' . $text . '\\[/quote\\])'; + $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quotepost&p=' . $post['post_id'] . '&sid=' . $this->sid); - $this->assertContains($expected, $crawler->filter('textarea#message')->text()); + $this->assertRegexp($expected, $crawler->filter('textarea#message')->text()); + } + + public function test_quote_pm() + { + $text = 'This is a test private message sent by the testing framework.'; + $expected = '(\\[quote="admin" time="\\d+" user_id="2"\\]' . $text . '\\[/quote\\])'; + + $this->login(); + $message_id = $this->create_private_message('Test', $text, array(2)); + + $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quote&p=' . $message_id . '&sid=' . $this->sid); + + $this->assertRegexp($expected, $crawler->filter('textarea#message')->text()); } public function test_quote_forward() -- cgit v1.2.1 From 4f1b25706f6a1ae6eb1c6c60ef27b42bb7ac4b40 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 24 Jun 2015 22:20:39 +0200 Subject: [ticket/10620] Removed extraneous quotes from attribute values PHPBB3-10620 --- tests/functional/private_messages_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index 9bfb5bc7ad..a7d1a29e80 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -75,7 +75,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic'); $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text); - $expected = '(\\[quote="admin" post_id="' . $post['post_id'] . '" time="\\d+" user_id="2"\\]' . $text . '\\[/quote\\])'; + $expected = '(\\[quote=admin post_id=' . $post['post_id'] . ' time=\\d+ user_id=2\\]' . $text . '\\[/quote\\])'; $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quotepost&p=' . $post['post_id'] . '&sid=' . $this->sid); @@ -85,7 +85,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_pm() { $text = 'This is a test private message sent by the testing framework.'; - $expected = '(\\[quote="admin" time="\\d+" user_id="2"\\]' . $text . '\\[/quote\\])'; + $expected = '(\\[quote=admin time=\\d+ user_id=2\\]' . $text . '\\[/quote\\])'; $this->login(); $message_id = $this->create_private_message('Test', $text, array(2)); @@ -98,7 +98,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_forward() { $text = 'This is a test private message sent by the testing framework.'; - $expected = "[quote=\"admin\"]\n" . $text . "\n[/quote]"; + $expected = '[quote=admin]' . $text . '[/quote]'; $this->login(); $message_id = $this->create_private_message('Test', $text, array(2)); -- cgit v1.2.1 From 1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 24 Jun 2015 23:42:36 +0200 Subject: [ticket/10620] Fixed functional tests to account for newlines PHPBB3-10620 --- tests/functional/private_messages_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index a7d1a29e80..7fda26fb49 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -85,7 +85,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_pm() { $text = 'This is a test private message sent by the testing framework.'; - $expected = '(\\[quote=admin time=\\d+ user_id=2\\]' . $text . '\\[/quote\\])'; + $expected = "(\\[quote=admin time=\\d+ user_id=2\\]\n" . $text . "\n\\[/quote\\])"; $this->login(); $message_id = $this->create_private_message('Test', $text, array(2)); @@ -98,7 +98,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_forward() { $text = 'This is a test private message sent by the testing framework.'; - $expected = '[quote=admin]' . $text . '[/quote]'; + $expected = "[quote=admin]\n" . $text . "\n[/quote]"; $this->login(); $message_id = $this->create_private_message('Test', $text, array(2)); -- cgit v1.2.1 From 17f8134a3b1003a90b4f20ad36b03e637ec67b5a Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Thu, 5 Dec 2019 10:32:27 +0100 Subject: [ticket/16247] Add test not tested PHPBB3-16247 --- tests/functional/private_messages_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functional/private_messages_test.php') diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index 7fda26fb49..ce709524a9 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -85,7 +85,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case public function test_quote_pm() { $text = 'This is a test private message sent by the testing framework.'; - $expected = "(\\[quote=admin time=\\d+ user_id=2\\]\n" . $text . "\n\\[/quote\\])"; + $expected = "(\\[quote=admin msg_id=\\d+ time=\\d+ user_id=2\\]\n" . $text . "\n\\[/quote\\])"; $this->login(); $message_id = $this->create_private_message('Test', $text, array(2)); -- cgit v1.2.1