Skip to content

Commit

Permalink
Merge branch 'fix/#2635-date-diffing-failure-test-suite-fixes' into 2.5
Browse files Browse the repository at this point in the history
Backport #2635 to 2.5.*
  • Loading branch information
Ocramius committed Feb 6, 2017
2 parents 1b1effb + b74a0b8 commit 77b764a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ public function testDateArithmetics()
$row = $this->_conn->fetchAssoc($sql);
$row = array_change_key_case($row, CASE_LOWER);

$diff = floor( (strtotime('2010-01-01')-time()) / 3600 / 24);
$this->assertEquals($diff, (int)$row['diff'], "Date difference should be approx. ".$diff." days.", 1);
$diff = (strtotime('2010-01-01') - strtotime(date('Y-m-d'))) / 3600 / 24;
$this->assertEquals($diff, $row['diff'], "Date difference should be approx. ".$diff." days.", 1);
$this->assertEquals('2010-01-01 10:10:11', date('Y-m-d H:i:s', strtotime($row['add_seconds'])), "Adding second should end up on 2010-01-01 10:10:11");
$this->assertEquals('2010-01-01 10:10:09', date('Y-m-d H:i:s', strtotime($row['sub_seconds'])), "Subtracting second should end up on 2010-01-01 10:10:09");
$this->assertEquals('2010-01-01 10:15:10', date('Y-m-d H:i:s', strtotime($row['add_minutes'])), "Adding minutes should end up on 2010-01-01 10:15:10");
Expand Down

0 comments on commit 77b764a

Please sign in to comment.