Skip to content

Commit

Permalink
support DateTime and DateTimeImmutable
Browse files Browse the repository at this point in the history
  • Loading branch information
TRPB committed Apr 11, 2020
1 parent d5301b5 commit 39bb9c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/MySqlDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ public function testDateColumnSave() {

$blog = new Blog;
$blog->title = 'ABC123';
$blog->date = new \DateTime;
$blog->date = new \DateTimeImmutable;
$blog->id = 2;
$mapper[] = $blog;

Expand All @@ -784,7 +784,7 @@ public function testDateColumnRead() {

$blog = new Blog;
$blog->title = 'ABC123';
$blog->date = new \DateTime;
$blog->date = new \DateTimeImmutable;
$blog->id = 7;
$mapper[] = $blog;

Expand All @@ -793,7 +793,7 @@ public function testDateColumnRead() {

$blog7 = $mapper[7];

$this->assertInstanceOf('\DateTime', $blog7->date);
$this->assertInstanceOf('\DateTimeImmutable', $blog7->date);
$this->assertEquals($blog->date->format('Y-m-d'), $blog7->date->format('Y-m-d'));

}
Expand All @@ -804,7 +804,7 @@ public function testDateColumnFilter() {
$this->populateBlogs();
$blogs = new \Maphper\Maphper($this->getDataSource('blog'));

$b = $blogs->filter(['date' => new \DateTime('2015-01-02')]);
$b = $blogs->filter(['date' => new \DateTimeImmutable('2015-01-02')]);

$this->assertEquals(count($b), 4);

Expand Down

0 comments on commit 39bb9c6

Please sign in to comment.