Completed
Pull Request — master (#5574)
by Christopher
11:14
created

TimeTest::testNice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
use SilverStripe\Model\FieldType\DBField;
4
5
/**
6
 * @package framework
7
 * @subpackage tests
8
 */
9
class TimeTest extends SapphireTest {
10
11
	public function testNice() {
12
		$time = DBField::create_field('Time', '17:15:55');
13
		$this->assertEquals('5:15pm', $time->Nice());
14
15
		Config::inst()->update('SilverStripe\Model\FieldType\DBTime', 'nice_format', 'H:i:s');
16
		$this->assertEquals('17:15:55', $time->Nice());
17
	}
18
19
}
20