diff options
author | Tristan Darricau <github@nicofuma.fr> | 2017-01-15 12:36:26 +0100 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2017-01-15 12:36:26 +0100 |
commit | 4fd6b0fd88a0ea616a64ce746d3be260cc837138 (patch) | |
tree | b3fa4c9ebfe3a261e2a2aeea815123fe2fc316d8 /tests/functional | |
parent | 2637606ae1b033c12a34efd946dac145a679945f (diff) | |
parent | a3accfaf461bc963f0661bdab1befbc9ef50a514 (diff) | |
download | forums-4fd6b0fd88a0ea616a64ce746d3be260cc837138.tar forums-4fd6b0fd88a0ea616a64ce746d3be260cc837138.tar.gz forums-4fd6b0fd88a0ea616a64ce746d3be260cc837138.tar.bz2 forums-4fd6b0fd88a0ea616a64ce746d3be260cc837138.tar.xz forums-4fd6b0fd88a0ea616a64ce746d3be260cc837138.zip |
Merge pull request #4632 from VSEphpbb/ticket/14989
[ticket/14989] Allow more admin-configurable schemes in post links
* VSEphpbb/ticket/14989:
[ticket/14989] Allow more admin-configurable schemes in post links
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/posting_test.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php index 83acefd2f3..8e6328d1d3 100644 --- a/tests/functional/posting_test.php +++ b/tests/functional/posting_test.php @@ -264,4 +264,45 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case // Test that the preview contains the correct link $this->assertEquals($url, $crawler->filter('#preview a')->attr('href')); } + + public function test_allowed_schemes_links() + { + $text = 'http://example.org/ tcp://localhost:22/ServiceName'; + + $this->login(); + $this->admin_login(); + + // Post with default settings + $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); + $this->assertContains( + '<a href="http://example.org/" class="postlink">http://example.org/</a> tcp://localhost:22/ServiceName', + $crawler->filter('#preview .content')->html() + ); + + // Update allowed schemes + $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post'); + $form = $crawler->selectButton('Submit')->form(); + $values = $form->getValues(); + $values['config[allowed_schemes_links]'] = 'https,tcp'; + $form->setValues($values); + $crawler = self::submit($form); + $this->assertEquals(1, $crawler->filter('.successbox')->count()); + + // Post with new settings + $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); + $this->assertContains( + 'http://example.org/ <a href="tcp://localhost:22/ServiceName" class="postlink">tcp://localhost:22/ServiceName</a>', + $crawler->filter('#preview .content')->html() + ); + } } |