Skip to content

Commit

Permalink
Adding tests for TextHelper::autolinkurl(). Closes #1466
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 18, 2011
1 parent 6071788 commit ab337e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cake/tests/cases/libs/view/helpers/text.test.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit ab337e2

Please sign in to comment.