From 2787052bdd4e30a07b0c4edd98827a48ed00808b Mon Sep 17 00:00:00 2001 From: dogmatic69 Date: Thu, 23 Feb 2012 11:17:58 +0000 Subject: [PATCH] adding a truncate test for a url as explained in #2610 --- lib/Cake/Test/Case/Utility/StringTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cake/Test/Case/Utility/StringTest.php b/lib/Cake/Test/Case/Utility/StringTest.php index 626521d34..5571fee23 100644 --- a/lib/Cake/Test/Case/Utility/StringTest.php +++ b/lib/Cake/Test/Case/Utility/StringTest.php @@ -370,6 +370,7 @@ TEXT; $text7 = 'El moño está en el lugar correcto. Eso fue lo que dijo la niña, ¿habrá dicho la verdad?'; $text8 = 'Vive la R' . chr(195) . chr(169) . 'publique de France'; $text9 = 'НОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыь'; + $text10 = 'http://example.com/something/foo:bar'; $this->assertSame($this->Text->truncate($text1, 15), 'The quick br...'); $this->assertSame($this->Text->truncate($text1, 15, array('exact' => false)), 'The quick...'); @@ -394,6 +395,7 @@ TEXT; $this->assertSame($this->Text->truncate($text7, 15), 'El moño está...'); $this->assertSame($this->Text->truncate($text8, 15), 'Vive la R'.chr(195).chr(169).'pu...'); $this->assertSame($this->Text->truncate($text9, 10), 'НОПРСТУ...'); + $this->assertSame($this->Text->truncate($text10, 30), 'http://example.com/somethin...'); $text = '

Iamatestwithnospacesandhtml

'; $result = $this->Text->truncate($text, 10, array(