Adding tests for TextHelper::autolinkurl(). Closes #1466

This commit is contained in:
mark_story 2011-01-18 18:56:35 -05:00
parent 6071788478
commit ab337e2e8a

View file

@ -280,6 +280,16 @@ class TextHelperTest extends CakeTestCase {
$expected = 'Text with a url <a href="http://www.cot.ag/cuIb2Q">www.cot.ag/cuIb2Q</a> and more'; $expected = 'Text with a url <a href="http://www.cot.ag/cuIb2Q">www.cot.ag/cuIb2Q</a> and more';
$result = $this->Text->autoLinkUrls($text); $result = $this->Text->autoLinkUrls($text);
$this->assertEqual($expected, $result); $this->assertEqual($expected, $result);
$text = 'Text with a url http://www.does--not--work.com and more';
$expected = 'Text with a url <a href="http://www.does--not--work.com">http://www.does--not--work.com</a> and more';
$result = $this->Text->autoLinkUrls($text);
$this->assertEqual($expected, $result);
$text = 'Text with a url http://www.not--work.com and more';
$expected = 'Text with a url <a href="http://www.not--work.com">http://www.not--work.com</a> and more';
$result = $this->Text->autoLinkUrls($text);
$this->assertEqual($expected, $result);
} }
/** /**