Closed
Description
I have the following date class which I use just to represent dates by extending the datetime object.
Code in Date.php
class Date extends \DateTime
{
public function __construct($time='now', \DateTimeZone $timezone=null)
{
parent::__construct($time, $timezone);
$this->setTime(0, 0, 0);
}
public function __toString() {
return $this->format('Y-m-d');
}
}
While trying to use timecop in my test cases it throws the following error -
PHP Fatal error: Class entry requested for an object without PHP class in
Date.php
Basically when calling the constructor with the timezone parameter as null does not work.
Metadata
Metadata
Assignees
Labels
No labels