Closed tupikoff closed 3 years ago
I have a problem with mocking php Datetime object. Does AspectMock work correctly with global php objects?
code
$datetime = test::double(DateTime::class, ['format' => '1979-06-18']); $date = (new DateTime())->format('Y-m-d'); $datetime->verifyInvoked('format'); $this->assertEquals('1979-06-18', $date);
will raise
Expected DateTime::format to be invoked but it never occurred
I'm currently using Chronos instead of using \DateTime, because I had the same problem trying to double \DateTime class
This is a missing feature of goaop: https://github.com/goaop/framework/issues/188
I have a problem with mocking php Datetime object. Does AspectMock work correctly with global php objects?
code
will raise