Exemplo n.º 1
0
 public function testUntilDuring()
 {
     $point = new TimePoint(2012, 1, 1, 9, 30);
     $expectedInterval = new TimeInterval(new TimePoint(2012, 1, 1, 9, 30), new TimePoint(2012, 1, 1, 13, 30));
     $this->assertTrue($expectedInterval->isEquals($point->during(new Duration(4, TimeUnit::hour()))));
     $this->assertTrue($expectedInterval->isEquals($point->until(new TimePoint(2012, 1, 1, 13, 30))));
 }
Exemplo n.º 2
0
 public function testLength()
 {
     $interval = new TimeInterval(new TimePoint(2012, 1, 1, 9, 30), new TimePoint(2012, 1, 1, 13, 30));
     $expectedDuration = new Duration(4, TimeUnit::hour());
     $this->assertEquals($expectedDuration, $interval->getLength());
 }