123456789101112131415161718192021222324252627282930 |
- <?php
- use Luticate\Utils\Dbo\LuDateTimeDbo;
- use Luticate\Utils\Dbo\LuDboDeserializeException;
-
- /**
- * Created by PhpStorm.
- * User: robin
- * Date: 6/14/16
- * Time: 11:53 AM
- */
- class LuDateTimeDboTest extends \PHPUnit_Framework_TestCase
- {
- public function testDateTime()
- {
- $dbo = LuDateTimeDbo::jsonDeserialize('2016-12-24 14:42:24');
- $this->assertSame('2016-12-24 14:42:24', $dbo->getDateTime()->__toString());
- }
-
- public function testNull()
- {
- $dbo = LuDateTimeDbo::jsonDeserialize(null);
- $this->assertSame(null, $dbo->getDateTime());
- }
-
- public function testInvalid()
- {
- $this->expectException(LuDboDeserializeException::class);
- LuDateTimeDbo::jsonDeserialize('my date');
- }
- }
|