Ejemplo n.º 1
0
 public function test_adjustInto_ZonedDateTime()
 {
     $base = ZoneOffset::ofHoursMinutesSeconds(1, 1, 1);
     foreach (ZoneId::getAvailableZoneIds() as $zoneId) {
         //Do not change $offset of ZonedDateTime after adjustInto()
         $zonedDateTime_target = ZonedDateTime::ofDateAndTime(LocalDate::of(1909, 2, 2), LocalTime::of(10, 10, 10), ZoneId::of($zoneId));
         $zonedDateTime_result = $base->adjustInto($zonedDateTime_target);
         $this->assertEquals($zonedDateTime_target->getOffset(), $zonedDateTime_result->getOffset());
         $offsetDateTime_target = $zonedDateTime_target->toOffsetDateTime();
         $offsetDateTime_result = $base->adjustInto($offsetDateTime_target);
         $this->assertEquals($base, $offsetDateTime_result->getOffset());
     }
 }
Ejemplo n.º 2
0
 public function test_factory_of_LocalDateLocalTime_nullZone()
 {
     TestHelper::assertNullException($this, function () {
         ZonedDateTime::ofDateAndTime(LocalDate::of(2008, 6, 30), LocalTime::of(11, 30, 10, 500), null);
     });
 }