示例#1
0
 public function testIsBeforeOrEqual()
 {
     $subject = new LocalDate('2016-02-08T00:00:00', 'Europe/Berlin');
     $compare = new LocalDate('2016-02-08T01:30:00', 'Europe/Berlin');
     $this->assertTrue($subject->isBeforeOrEqual($compare));
     $subject = new LocalDate('2016-02-08T01:30:00', 'Europe/Berlin');
     $compare = new LocalDate('2016-02-08T01:30:00', 'Europe/Berlin');
     $this->assertTrue($subject->isBeforeOrEqual($compare));
     $subject = new LocalDate('2016-02-08T01:30:00', 'Europe/Berlin');
     $compare = new LocalDate('2016-02-08T01:29:59', 'Europe/Berlin');
     $this->assertFalse($subject->isBeforeOrEqual($compare));
     // also test across time zones
     $subject = new LocalDate('2016-02-08T01:30:00', 'Europe/Berlin');
     $compare = new LocalDate('2016-02-08T00:30:00', 'Europe/London');
     $this->assertTrue($subject->isBeforeOrEqual($compare));
     // also test across time zones
     $subject = new LocalDate('2016-02-08T01:30:00', 'Europe/Berlin');
     $compare = new LocalDate('2016-02-08T00:29:59', 'Europe/London');
     $this->assertFalse($subject->isBeforeOrEqual($compare));
 }