aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-06-24 23:42:36 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-06-25 22:51:43 +0200
commit1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f (patch)
tree840d0ca9c2c78c6795991016453a40e8c08a2c9b
parent5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5 (diff)
downloadforums-1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f.tar
forums-1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f.tar.gz
forums-1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f.tar.bz2
forums-1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f.tar.xz
forums-1f6b9bc0487ba43a614b05528dcd9ae830cc3b0f.zip
[ticket/10620] Fixed functional tests to account for newlines
PHPBB3-10620
-rw-r--r--tests/functional/posting_test.php4
-rw-r--r--tests/functional/private_messages_test.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index 4f4ecfef45..e9b62c0b6c 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -75,7 +75,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
public function test_quote()
{
$text = 'Test post </textarea>"\' &&amp;amp;';
- $expected = '([quote=admin[^]]*\\]' . preg_quote($text) . '\\[/quote\\])';
+ $expected = "(\\[quote=admin[^\\]]*\\]\n" . preg_quote($text) . "\n\\[/quote\\])";
$this->login();
$topic = $this->create_topic(2, 'Test Topic 1', 'Test topic');
@@ -110,7 +110,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
$this->set_quote_depth($quote_depth);
$crawler = self::request('GET', $quote_url);
$this->assertRegexp(
- '(\\[quote=admin[^]]*\\]' . preg_quote($expected_text) . '\\[/quote\\])',
+ "(\\[quote=admin[^\\]]*\\]\n?" . preg_quote($expected_text) . "\n?\\[/quote\\])",
$crawler->filter('textarea#message')->text()
);
}
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));