public function testParseWithTestValueSet() { $notNow = Date::yesterday(); Date::setTestNow($notNow); $this->assertEquals($notNow, Date::parse()); $this->assertEquals($notNow, Date::parse(null)); $this->assertEquals($notNow, Date::parse('')); $this->assertEquals($notNow, Date::parse('now')); }
public function testYesterdayWithTimezone() { $dt = Date::yesterday('Europe/London'); $dt2 = new \DateTime('yesterday', new \DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); }