2012-01-31 11:44:16 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2012-01-31 11:44:16 +01:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
|
|
|
|
class StringFieldTest extends SapphireTest {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @covers StringField->LowerCase()
|
|
|
|
*/
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testLowerCase() {
|
2012-01-31 11:44:16 +01:00
|
|
|
$this->assertEquals(
|
|
|
|
'this is a test!',
|
2012-03-27 06:57:42 +02:00
|
|
|
DBField::create_field('StringFieldTest_MyStringField', 'This is a TEST!')->LowerCase()
|
2012-01-31 11:44:16 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @covers StringField->UpperCase()
|
|
|
|
*/
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testUpperCase() {
|
2012-01-31 11:44:16 +01:00
|
|
|
$this->assertEquals(
|
|
|
|
'THIS IS A TEST!',
|
2012-03-27 06:57:42 +02:00
|
|
|
DBField::create_field('StringFieldTest_MyStringField', 'This is a TEST!')->UpperCase()
|
2012-01-31 11:44:16 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class StringFieldTest_MyStringField extends StringField implements TestOnly {
|
2012-09-19 12:07:39 +02:00
|
|
|
public function requireField() {}
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|