Skip to content
This repository
Browse code

adding a truncate test for a url as explained in #2610

  • Loading branch information...
commit 2787052bdd4e30a07b0c4edd98827a48ed00808b 1 parent c6449f6
Carl Sutton authored February 23, 2012

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  lib/Cake/Test/Case/Utility/StringTest.php
2  lib/Cake/Test/Case/Utility/StringTest.php
@@ -370,6 +370,7 @@ public function testTruncate() {
370 370
 		$text7 = 'El moño está en el lugar correcto. Eso fue lo que dijo la niña, ¿habrá dicho la verdad?';
371 371
 		$text8 = 'Vive la R' . chr(195) . chr(169) . 'publique de France';
372 372
 		$text9 = 'НОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыь';
  373
+		$text10 = 'http://example.com/something/foo:bar';
373 374
 
374 375
 		$this->assertSame($this->Text->truncate($text1, 15), 'The quick br...');
375 376
 		$this->assertSame($this->Text->truncate($text1, 15, array('exact' => false)), 'The quick...');
@@ -394,6 +395,7 @@ public function testTruncate() {
394 395
 		$this->assertSame($this->Text->truncate($text7, 15), 'El moño está...');
395 396
 		$this->assertSame($this->Text->truncate($text8, 15), 'Vive la R'.chr(195).chr(169).'pu...');
396 397
 		$this->assertSame($this->Text->truncate($text9, 10), 'НОПРСТУ...');
  398
+		$this->assertSame($this->Text->truncate($text10, 30), 'http://example.com/somethin...');
397 399
 
398 400
 		$text = '<p><span style="font-size: medium;"><a>Iamatestwithnospacesandhtml</a></span></p>';
399 401
 		$result = $this->Text->truncate($text, 10, array(

0 notes on commit 2787052

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