aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/posting_test.php
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-12-28 19:44:33 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-12-28 19:46:46 +0100
commit7273e24101e9cc5d244ddda4e6c674b8960ed0ba (patch)
treec6ea1c201d823824e7c0ec0f80173027c6431d82 /tests/functional/posting_test.php
parent0efbb78afa210becfc855fb99c879d7e308f9d3c (diff)
downloadforums-7273e24101e9cc5d244ddda4e6c674b8960ed0ba.tar
forums-7273e24101e9cc5d244ddda4e6c674b8960ed0ba.tar.gz
forums-7273e24101e9cc5d244ddda4e6c674b8960ed0ba.tar.bz2
forums-7273e24101e9cc5d244ddda4e6c674b8960ed0ba.tar.xz
forums-7273e24101e9cc5d244ddda4e6c674b8960ed0ba.zip
[ticket/10628] Added test
Tests that the textarea's content is preserved, that no "http://" is added to the text or to the preview's HTML and that the www URL is linkified PHPBB3-10628
Diffstat (limited to 'tests/functional/posting_test.php')
-rw-r--r--tests/functional/posting_test.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index 724c42b289..bf9e3eb51a 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -205,4 +205,29 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
$crawler->filter('#preview .signature')->html()
);
}
+
+ /**
+ * @ticket PHPBB3-10628
+ */
+ public function test_www_links_preview()
+ {
+ $text = 'www.example.org';
+ $url = 'http://' . $text;
+
+ $this->add_lang('posting');
+ $this->login();
+
+ $crawler = self::request('GET', 'posting.php?mode=post&f=2');
+ $form = $crawler->selectButton('Preview')->form(array(
+ 'subject' => 'Test subject',
+ 'message' => $text
+ ));
+ $crawler = self::submit($form);
+
+ // Test that the textarea remains unchanged
+ $this->assertEquals($text, $crawler->filter('#message')->text());
+
+ // Test that the preview contains the correct link
+ $this->assertEquals($url, $crawler->filter('#preview a')->attr('href'));
+ }
}