Skip to content

Commit

Permalink
Add some additional tests for autoLink.
Browse files Browse the repository at this point in the history
Refs #5544
  • Loading branch information
markstory committed Jan 3, 2015
1 parent 76b7c8c commit b6029d7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Cake/Test/Case/View/Helper/TextHelperTest.php
Expand Up @@ -161,6 +161,16 @@ public function testAutoLink() {
$expected = 'This is a test text with URL [<a href="http://www.example.com?aParam[]=value1&amp;aParam[]=value2&amp;aParam[]=value3">http://www.example.com?aParam[]=value1&amp;aParam[]=value2&amp;aParam[]=value3</a>] in square brackets';
$result = $this->Text->autoLink($text);
$this->assertEquals($expected, $result);

$text = 'This is a test text with URL ;http://www.cakephp.org/page/4; semi-colon';
$expected = 'This is a test text with URL ;<a href="http://www.cakephp.org/page/4">http://www.cakephp.org/page/4</a>; semi-colon';
$result = $this->Text->autoLink($text);
$this->assertEquals($expected, $result);

$text = 'This is a test text with URL (http://www.cakephp.org/page/4/other(thing)) brackets';
$expected = 'This is a test text with URL (<a href="http://www.cakephp.org/page/4/other(thing)">http://www.cakephp.org/page/4/other(thing)</a>) brackets';
$result = $this->Text->autoLink($text);
$this->assertEquals($expected, $result);
}

/**
Expand Down

0 comments on commit b6029d7

Please sign in to comment.