StringFieldTest.php
915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
 * @package framework
 * @subpackage tests
 */
class StringFieldTest extends SapphireTest {
	/**
	 * @covers StringField->forTemplate()
	 */
	public function testForTemplate() {
		$this->assertEquals(
			"this is<br />\na test!",
			DBField::create_field('StringFieldTest_MyStringField', "this is\na test!")->forTemplate()
		);
	}
	
	/**
	 * @covers StringField->LowerCase()
	 */
	public function testLowerCase() {
		$this->assertEquals(
			'this is a test!',
			DBField::create_field('StringFieldTest_MyStringField', 'This is a TEST!')->LowerCase()
		);
	}
	/**
	 * @covers StringField->UpperCase()
	 */
	public 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 {
	public function requireField() {}
}