2016-05-15 21:25:56 +12:00
|
|
|
<?php
|
2016-05-20 12:55:35 +01:00
|
|
|
|
2016-10-14 14:30:05 +13:00
|
|
|
namespace SilverStripe\ORM\Tests;
|
2016-06-15 16:03:16 +12:00
|
|
|
|
|
|
|
use SilverStripe\ORM\FieldType\DBField;
|
2016-08-19 10:51:35 +12:00
|
|
|
use SilverStripe\Dev\SapphireTest;
|
2016-10-14 14:30:05 +13:00
|
|
|
use SilverStripe\ORM\FieldType\DBTime;
|
2016-08-19 10:51:35 +12:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
class TimeTest extends SapphireTest
|
|
|
|
{
|
2016-05-15 21:25:56 +12:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
public function testNice()
|
|
|
|
{
|
|
|
|
$time = DBField::create_field('Time', '17:15:55');
|
|
|
|
$this->assertEquals('5:15pm', $time->Nice());
|
2016-05-15 21:25:56 +12:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
DBTime::config()->update('nice_format', 'H:i:s');
|
|
|
|
$this->assertEquals('17:15:55', $time->Nice());
|
|
|
|
}
|
2016-05-15 21:25:56 +12:00
|
|
|
}
|