mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 17:51:34 +02:00
API CHANGE Deprecated StringField->Lower() and Upper(), use String->LowerCase() and UpperCase() instead. Moved methods from DBField to StringField.
33 lines
640 B
PHP
33 lines
640 B
PHP
<?php
|
|
/**
|
|
* @package sapphire
|
|
* @subpackage tests
|
|
*/
|
|
|
|
class StringFieldTest extends SapphireTest {
|
|
|
|
/**
|
|
* @covers StringField->LowerCase()
|
|
*/
|
|
function testLowerCase() {
|
|
$this->assertEquals(
|
|
'this is a test!',
|
|
DBField::create('StringFieldTest_MyStringField', 'This is a TEST!')->LowerCase()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @covers StringField->UpperCase()
|
|
*/
|
|
function testUpperCase() {
|
|
$this->assertEquals(
|
|
'THIS IS A TEST!',
|
|
DBField::create('StringFieldTest_MyStringField', 'This is a TEST!')->UpperCase()
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
class StringFieldTest_MyStringField extends StringField implements TestOnly {
|
|
function requireField() {}
|
|
} |