2009-02-12 10:38:43 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class HTMLTextTest extends SapphireTest {
|
|
|
|
|
|
|
|
/**
|
2009-02-12 10:40:14 +01:00
|
|
|
* Test {@link HTMLText->LimitCharacters()}
|
2009-02-12 10:38:43 +01:00
|
|
|
*/
|
|
|
|
function testLimitCharacters() {
|
|
|
|
$cases = array(
|
|
|
|
'The little brown fox jumped over the lazy cow.' => 'The little brown fox...',
|
|
|
|
'<p>This is some text in a paragraph.</p>' => 'This is some text in...'
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach($cases as $originalValue => $expectedValue) {
|
|
|
|
$textObj = new HTMLText('Test');
|
|
|
|
$textObj->setValue($originalValue);
|
|
|
|
$this->assertEquals($expectedValue, $textObj->LimitCharacters());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|