Skip to content
This repository
Browse code

Adding tests for TextHelper::autolinkurl(). Closes #1466

  • Loading branch information...
commit ab337e2e8a3ad7f2291f5db6cc4cedd6a9cfdb9c 1 parent 6071788
Mark Story authored January 18, 2011
10  cake/tests/cases/libs/view/helpers/text.test.php
@@ -280,6 +280,16 @@ function testAutoLinkUrls() {
280 280
 		$expected = 'Text with a url <a href="http://www.cot.ag/cuIb2Q">www.cot.ag/cuIb2Q</a> and more';
281 281
 		$result = $this->Text->autoLinkUrls($text);
282 282
 		$this->assertEqual($expected, $result);
  283
+		
  284
+		$text = 'Text with a url http://www.does--not--work.com and more';
  285
+		$expected = 'Text with a url <a href="http://www.does--not--work.com">http://www.does--not--work.com</a> and more';
  286
+		$result = $this->Text->autoLinkUrls($text);
  287
+		$this->assertEqual($expected, $result);
  288
+		
  289
+		$text = 'Text with a url http://www.not--work.com and more';
  290
+		$expected = 'Text with a url <a href="http://www.not--work.com">http://www.not--work.com</a> and more';
  291
+		$result = $this->Text->autoLinkUrls($text);
  292
+		$this->assertEqual($expected, $result);
283 293
 	}
284 294
 
285 295
 /**

0 notes on commit ab337e2

Please sign in to comment.
Something went wrong with that request. Please try again.