silverstripe-framework/tests/model/StringFieldTest.php
Andrew O'Neil de2832e65f ENHANCEMENT: Allow Object::create() to be called with late static binding.
This allows DataList::create('SiteTree') as equivalent to Object::create('DataList', 'SiteTree'), without
having to have a create() function on DataList. Required for E_STRICT compliance.
2012-03-27 17:57:42 +13:00

33 lines
652 B
PHP

<?php
/**
* @package sapphire
* @subpackage tests
*/
class StringFieldTest extends SapphireTest {
/**
* @covers StringField->LowerCase()
*/
function testLowerCase() {
$this->assertEquals(
'this is a test!',
DBField::create_field('StringFieldTest_MyStringField', 'This is a TEST!')->LowerCase()
);
}
/**
* @covers StringField->UpperCase()
*/
function testUpperCase() {
$this->assertEquals(
'THIS IS A TEST!',
DBField::create_field('StringFieldTest_MyStringField', 'This is a TEST!')->UpperCase()
);
}
}
class StringFieldTest_MyStringField extends StringField implements TestOnly {
function requireField() {}
}