Skip to content

Commit

Permalink
Test brackets are not autolinked inside href tag
Browse files Browse the repository at this point in the history
  • Loading branch information
robmcvey committed Jan 2, 2015
1 parent fcb6520 commit 1ebcd9b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Cake/Test/Case/View/Helper/TextHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ public function testAutoLink() {
$expected = 'This is a test text with URL <a href="http://www.cakephp.org">http://www.cakephp.org</a>(and some more text)';
$result = $this->Text->autoLink($text);
$this->assertEquals($expected, $result);

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

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

/**
Expand Down

0 comments on commit 1ebcd9b

Please sign in to comment.