mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[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
This commit is contained in:
parent
0efbb78afa
commit
7273e24101
1 changed files with 25 additions and 0 deletions
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue