You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
{
publicfunction__construct($time='now', \DateTimeZone$timezone=null)
{
parent::__construct($time, $timezone);
$this->setTime(0, 0, 0);
}
publicfunction__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.
The text was updated successfully, but these errors were encountered:
daveamol
changed the title
Issue with using timecop with classes which a class extending datetime
Issue with using timecop constructor
Jul 3, 2015
I have the following date class which I use just to represent dates by extending the datetime object.
Code in Date.php
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.
The text was updated successfully, but these errors were encountered: