Skip to content

Commit

Permalink
Made date test more lenient
Browse files Browse the repository at this point in the history
  • Loading branch information
pkruithof committed Feb 10, 2017
1 parent 0adc61d commit d59d145
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace TreeHouse\Queue\Tests\Processor\Retry;

use DateTime;
use Mockery as Mock;
use Mockery\MockInterface;
use TreeHouse\Queue\Amqp\EnvelopeInterface;
Expand Down Expand Up @@ -36,7 +37,7 @@ public function it_can_retry_a_message()

$attempt = 2;
$cooldownTime = 60;
$cooldownDate = \DateTime::createFromFormat('U', time() + ($attempt * $cooldownTime));
$cooldownDate = DateTime::createFromFormat('U', time() + ($attempt * $cooldownTime));

$publisher = $this->createPublisherMock();
$publisher
Expand Down Expand Up @@ -76,7 +77,16 @@ public function it_can_retry_a_message()

return true;
}),
equalTo($cooldownDate)
Mock::on(function (DateTime $actual) use ($cooldownDate) {
$this->assertEquals(
$cooldownDate,
$actual,
'',
2
);

return true;
})
)
->andReturn(true)
;
Expand Down

0 comments on commit d59d145

Please sign in to comment.