|
|
@@ -174,6 +174,31 @@ class TextHelperTest extends TestCase
|
|
|
$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);
|
|
|
+
|
|
|
+ $text = 'This is a test text with URL [http://www.example.com?aParam[]=value1&aParam[]=value2&aParam[]=value3] in square brackets';
|
|
|
+ $expected = 'This is a test text with URL [<a href="http://www.example.com?aParam[]=value1&aParam[]=value2&aParam[]=value3">http://www.example.com?aParam[]=value1&aParam[]=value2&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);
|
|
|
}
|
|
|
|
|
|
/**
|