diff --git a/tests/fieldtypes/TextTest.php b/tests/fieldtypes/TextTest.php index 73f91c4e0..b8b3898bd 100644 --- a/tests/fieldtypes/TextTest.php +++ b/tests/fieldtypes/TextTest.php @@ -12,6 +12,7 @@ class TextTest extends SapphireTest { $cases = array( /* Standard words limited, ellipsis added if truncated */ 'The little brown fox jumped over the lazy cow.' => 'The little brown...', + ' This text has white space around the ends ' => 'This text has...', /* Words less than the limt word count don't get truncated, ellipsis not added */ 'Two words' => 'Two words', // Two words shouldn't have an ellipsis @@ -20,7 +21,8 @@ class TextTest extends SapphireTest { /* HTML tags get stripped out, leaving the raw text */ '

Text inside a paragraph tag should also work

' => 'Text inside a...', - '

Text nested inside another tag should also work

' => 'Text nested inside...' + '

Text nested inside another tag should also work

' => 'Text nested inside...', + '

Two words

' => 'Two words' ); foreach($cases as $originalValue => $expectedValue) { @@ -33,9 +35,12 @@ class TextTest extends SapphireTest { /** * Test {@link Text->LimitWordCountXML()} */ - /*function testLimitWordCountXML() { + function testLimitWordCountXML() { $cases = array( - // @todo add cases to test by + '

Stuff & stuff

' => 'Stuff &...', + "Stuff\nBlah Blah Blah" => "Stuff
Blah Blah...", + "Stuff "Stuff<Blah Blah", + "Stuff>Blah Blah" => "Stuff>Blah Blah" ); foreach($cases as $originalValue => $expectedValue) { @@ -43,7 +48,7 @@ class TextTest extends SapphireTest { $textObj->setValue($originalValue); $this->assertEquals($expectedValue, $textObj->LimitWordCountXML(3)); } - }*/ + } } ?> \ No newline at end of file