diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2015-06-16 08:16:56 +0200 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2015-06-25 03:11:55 +0200 |
commit | f02cc27014c27acaf44b27066959426db27b3493 (patch) | |
tree | bf8093cc0a8fe6a113719fa1eeaf27484e3da79f /tests/functional/posting_test.php | |
parent | 8747c7a2c17e2f5408f528f5213a3e056aefd54e (diff) | |
download | forums-f02cc27014c27acaf44b27066959426db27b3493.tar forums-f02cc27014c27acaf44b27066959426db27b3493.tar.gz forums-f02cc27014c27acaf44b27066959426db27b3493.tar.bz2 forums-f02cc27014c27acaf44b27066959426db27b3493.tar.xz forums-f02cc27014c27acaf44b27066959426db27b3493.zip |
[ticket/10620] Implemented quote improvements
PHPBB3-10620
Diffstat (limited to 'tests/functional/posting_test.php')
-rw-r--r-- | tests/functional/posting_test.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php index ccfeb10deb..d9e6cc5ab3 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;'; - $expected = '[quote="admin"]' . $text . '[/quote]'; + $expected = '([quote="admin"[^]]*\\]' . preg_quote($text) . '\\[/quote\\])'; $this->login(); $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic'); @@ -83,7 +83,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post['topic_id']}&p={$post['post_id']}&sid={$this->sid}"); - $this->assertContains($expected, $crawler->filter('textarea#message')->text()); + $this->assertRegexp($expected, $crawler->filter('textarea#message')->text()); } /** @@ -93,10 +93,10 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case { $text = '0[quote]1[quote]2[/quote]1[/quote]0'; $expected = array( - 0 => '[quote="admin"]0[quote]1[quote]2[/quote]1[/quote]0[/quote]', - 1 => '[quote="admin"]00[/quote]', - 2 => '[quote="admin"]0[quote]11[/quote]0[/quote]', - 3 => '[quote="admin"]0[quote]1[quote]2[/quote]1[/quote]0[/quote]', + 0 => '0[quote]1[quote]2[/quote]1[/quote]0', + 1 => '00', + 2 => '0[quote]11[/quote]0', + 3 => '0[quote]1[quote]2[/quote]1[/quote]0', ); $this->login(); @@ -109,7 +109,10 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case { $this->set_quote_depth($quote_depth); $crawler = self::request('GET', $quote_url); - $this->assertContains($expected_text, $crawler->filter('textarea#message')->text()); + $this->assertRegexp( + '(\\[quote="admin"[^]]*\\]' . preg_quote($expected_text) . '\\[/quote\\])', + $crawler->filter('textarea#message')->text() + ); } } |