Created test to prove #4941. Refs #4941

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7339 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
joelmoss 2008-07-15 11:01:44 +00:00
parent b2d74c8be1
commit 029f2ab75c

View file

@ -68,6 +68,7 @@ class TextTest extends UnitTestCase {
$text3 = '<b>&copy; 2005-2007, Cake Software Foundation, Inc.</b><br />written by Alexander Wegener';
$text4 = '<img src="mypic.jpg"> This image tag is not XHTML conform!<br><hr/><b>But the following image tag should be conform <img src="mypic.jpg" alt="Me, myself and I" /></b><br />Great, or?';
$text5 = '0<b>1<i>2<span class="myclass">3</span>4<u>5</u>6</i>7</b>8<b>9</b>0';
$text6 = "<p><strong>Extra dates have been announced for this year's tour.</strong></p>";
$this->assertIdentical($this->Text->{$m}($text1, 15), 'The quick br...');
$this->assertIdentical($this->Text->{$m}($text1, 15, '...', false), 'The quick...');
@ -89,6 +90,7 @@ class TextTest extends UnitTestCase {
$this->assertIdentical($this->Text->{$m}($text4, 90, '...', true, true), '<img src="mypic.jpg"> This image tag is not XHTML conform!<br><hr/><b>But the following image tag should be conform <img src="mypic.jpg" alt="Me, myself and I" /></b><br />Grea...');
$this->assertIdentical($this->Text->{$m}($text5, 6, '', true, true), '0<b>1<i>2<span class="myclass">3</span>4<u>5</u></i></b>');
$this->assertIdentical($this->Text->{$m}($text5, 20, '', true, true), $text5);
$this->assertIdentical($this->Text->{$m}($text6, 57, '...', false, true), "<p><strong>Extra dates have been announced for this year's...</strong></p>");
if ($this->method == 'truncate') {
$this->method = 'trim';