public function test_minus_TemporalAmount() { $period = MockSimplePeriod::of(7, CU::MONTHS()); $z = ZonedDateTime::ofDateTime(LocalDateTime::of(2008, 6, 1, 12, 30, 59, 500), self::ZONE_0100()); $expected = ZonedDateTime::ofDateTime(LocalDateTime::of(2007, 11, 1, 12, 30, 59, 500), self::ZONE_0100()); $this->assertEquals($z->minusAmount($period), $expected); }
/** * @expectedException \Celest\DateTimeException */ public function test_minus_TemporalAmount_invalidTooSmall() { $period = MockSimplePeriod::of(1, CU::YEARS()); LocalDateTime::of(Year::MIN_VALUE, 1, 1, 0, 0)->minusAmount($period); }
public function test_minus_Period() { $period = MockSimplePeriod::of(7, CU::MONTHS()); $t = self::TEST_2008_6_30_11_30_59_000000500()->minusAmount($period); $this->assertEquals($t, OffsetDateTime::of(2007, 11, 30, 11, 30, 59, 500, self::OFFSET_PONE())); }
/** * @expectedException \Celest\DateTimeException */ public function test_minus_TemporalAmount_dateNotAllowed() { $period = MockSimplePeriod::of(7, CU::MONTHS()); self::TEST_123040987654321()->minusAmount($period); }
public function test_minus_MinusAdjuster_noChange() { $t = self::TEST_11_30_59_500_PONE()->minusAmount(MockSimplePeriod::of(0, CU::SECONDS())); $this->assertEquals($t, self::TEST_11_30_59_500_PONE()); }
function data_badPlusTemporalAmount() { return [[MockSimplePeriod::of(2, CU::YEARS())], [MockSimplePeriod::of(2, CU::MONTHS())]]; }