Skip to content
Permalink
Browse files

Add tests for parse failures in DateTypes.

  • Loading branch information...
markstory committed Mar 7, 2013
1 parent d4a7ee5 commit 6bf528be4dcd935b395cd60d378e759367d1af71
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/Cake/Test/TestCase/Model/Datasource/Database/Type/DateTypeTest.php
@@ -49,6 +49,9 @@ public function testToPHP() {
$this->assertEqual('2001', $result->format('Y'));
$this->assertEqual('01', $result->format('m'));
$this->assertEqual('04', $result->format('d'));
$result = $this->type->toPHP('2001-01-04 10:11:12', $this->driver);
$this->assertFalse($result);
}
/**
@@ -64,6 +67,10 @@ public function testToDatabase() {
$date = new \DateTime('2013-08-12');
$result = $this->type->toDatabase($date, $this->driver);
$this->assertEquals('2013-08-12', $result);
$date = new \DateTime('2013-08-12 15:16:18');
$result = $this->type->toDatabase($date, $this->driver);
$this->assertEquals('2013-08-12', $result);
}
}

0 comments on commit 6bf528b

Please sign in to comment.
You can’t perform that action at this time.