aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/private_messages_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/private_messages_test.php')
-rw-r--r--tests/functional/private_messages_test.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php
index be584c20c1..7fda26fb49 100644
--- a/tests/functional/private_messages_test.php
+++ b/tests/functional/private_messages_test.php
@@ -69,22 +69,36 @@ 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\\]\n" . $text . "\n\\[/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()
{
$text = 'This is a test private message sent by the testing framework.';
- $expected = "[quote=\"admin\"]\n" . $text . "\n[/quote]";
+ $expected = "[quote=admin]\n" . $text . "\n[/quote]";
$this->login();
$message_id = $this->create_private_message('Test', $text, array(2));