assertNull($lot->isExpired(), 'Lot must be return null when no Expiration date is set!'); $datetime = new DateTime(); $lot->setExpirationDate($datetime->setTimestamp(strtotime('now +1 hour'))); $this->assertFalse($lot->isExpired(), 'Lot with expiration date in the future must not be expired!'); $lot->setExpirationDate($datetime->setTimestamp(strtotime('now -1 hour'))); $this->assertTrue($lot->isExpired(), 'Lot with expiration date in the past must be expired!'); } }