silverstripe-framework/tests/php/ORM/TimeTest.php

20 lines
436 B
PHP
Raw Normal View History

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