2016-05-15 11:25:56 +02:00
|
|
|
<?php
|
2016-05-20 13:55:35 +02:00
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
|
|
|
|
use SilverStripe\ORM\FieldType\DBField;
|
|
|
|
|
2016-05-20 13:55:35 +02:00
|
|
|
|
2016-05-15 11:25:56 +02:00
|
|
|
/**
|
|
|
|
* @package framework
|
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class TimeTest extends SapphireTest {
|
|
|
|
|
|
|
|
public function testNice() {
|
|
|
|
$time = DBField::create_field('Time', '17:15:55');
|
|
|
|
$this->assertEquals('5:15pm', $time->Nice());
|
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
Config::inst()->update('SilverStripe\\ORM\\FieldType\\DBTime', 'nice_format', 'H:i:s');
|
2016-05-15 11:25:56 +02:00
|
|
|
$this->assertEquals('17:15:55', $time->Nice());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|