/** * Creates a time interval. * * @param Time $start * @param Time $end * * @throws \InvalidArgumentException If the opening time is not earlier than closing time */ public function __construct(Time $start, Time $end) { $this->start = $start; $this->end = $end; if ($start->isAfterOrEqual($end)) { throw new \InvalidArgumentException(sprintf('The opening time "%s" must be before the closing time "%s".', $start->toString(), $end->toString())); } }
public function testConstructorFull() { $time = new Time(13, 37, 12); $this->assertEquals('13:37:12', $time->toString()); }