mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-18 07:26:40 +02:00
11dc761752
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71796 467b73ca-7a2a-4603-9d3b-597d59a354a9
25 lines
585 B
PHP
25 lines
585 B
PHP
<?php
|
|
/**
|
|
* @package sapphire
|
|
* @subpackage tests
|
|
*/
|
|
class HTMLTextTest extends SapphireTest {
|
|
|
|
/**
|
|
* Test {@link HTMLText->LimitCharacters()}
|
|
*/
|
|
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());
|
|
}
|
|
}
|
|
|
|
}
|
|
?>
|