Test brackets are not autolinked inside href tag

This commit is contained in:
Rob McVey 2015-01-02 15:08:21 +00:00
parent fcb6520ef1
commit 1ebcd9bf72

View file

@ -146,6 +146,16 @@ class TextHelperTest extends CakeTestCase {
$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);
}
/**