Permalink
Browse files

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

  • Loading branch information...
1 parent 6071788 commit ab337e2e8a3ad7f2291f5db6cc4cedd6a9cfdb9c @markstory markstory committed Jan 18, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 cake/tests/cases/libs/view/helpers/text.test.php
@@ -280,6 +280,16 @@ function testAutoLinkUrls() {
$expected = 'Text with a url <a href="http://www.cot.ag/cuIb2Q">www.cot.ag/cuIb2Q</a> and more';
$result = $this->Text->autoLinkUrls($text);
$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);
}
/**

0 comments on commit ab337e2

Please sign in to comment.