示例#1
0
 /**
  * @expectedException \Celest\ArithmeticException
  */
 public function test_minusDays_long_overflowTooSmall()
 {
     $t = Duration::ofDays(Math::div(Math::div(Long::MIN_VALUE, 3600), 24));
     $t->minusDays(1);
 }
 function data_minus_TemporalAmount()
 {
     return [[YearMonth::of(1, 1), Period::ofYears(1), YearMonth::of(0, 1), null], [YearMonth::of(1, 1), Period::ofYears(-12), YearMonth::of(13, 1), null], [YearMonth::of(1, 1), Period::ofYears(0), YearMonth::of(1, 1), null], [YearMonth::of(999999999, 12), Period::ofYears(0), YearMonth::of(999999999, 12), null], [YearMonth::of(-999999999, 1), Period::ofYears(0), YearMonth::of(-999999999, 1), null], [YearMonth::of(0, 1), Period::ofYears(999999999), YearMonth::of(-999999999, 1), null], [YearMonth::of(0, 12), Period::ofYears(-999999999), YearMonth::of(999999999, 12), null], [YearMonth::of(1, 1), Period::ofMonths(1), YearMonth::of(0, 12), null], [YearMonth::of(1, 1), Period::ofMonths(-12), YearMonth::of(2, 1), null], [YearMonth::of(1, 1), Period::ofMonths(121), YearMonth::of(-10, 12), null], [YearMonth::of(1, 1), Period::ofMonths(0), YearMonth::of(1, 1), null], [YearMonth::of(999999999, 12), Period::ofMonths(0), YearMonth::of(999999999, 12), null], [YearMonth::of(-999999999, 1), Period::ofMonths(0), YearMonth::of(-999999999, 1), null], [YearMonth::of(-999999999, 2), Period::ofMonths(1), YearMonth::of(-999999999, 1), null], [YearMonth::of(999999999, 11), Period::ofMonths(-1), YearMonth::of(999999999, 12), null], [YearMonth::of(1, 1), Period::ofYears(1)->withMonths(2), YearMonth::of(-1, 11), null], [YearMonth::of(1, 1), Period::ofYears(-12)->withMonths(-1), YearMonth::of(13, 2), null], [YearMonth::of(1, 1), Period::ofMonths(2)->withYears(1), YearMonth::of(-1, 11), null], [YearMonth::of(1, 1), Period::ofMonths(-1)->withYears(-12), YearMonth::of(13, 2), null], [YearMonth::of(1, 1), Period::ofDays(365), null, DateTimeException::class], [YearMonth::of(1, 1), Duration::ofDays(365), null, DateTimeException::class], [YearMonth::of(1, 1), Duration::ofHours(365 * 24), null, DateTimeException::class], [YearMonth::of(1, 1), Duration::ofMinutes(365 * 24 * 60), null, DateTimeException::class], [YearMonth::of(1, 1), Duration::ofSeconds(365 * 24 * 3600), null, DateTimeException::class], [YearMonth::of(1, 1), Duration::ofNanos(365 * 24 * 3600 * 1000000000), null, DateTimeException::class]];
 }
示例#3
0
 function data_minusInvalidUnit()
 {
     return [[Period::of(0, 1, 0)], [Period::of(0, 0, 1)], [Period::of(0, 1, 1)], [Period::of(1, 1, 1)], [Duration::ofDays(1)], [Duration::ofHours(1)], [Duration::ofMinutes(1)], [Duration::ofSeconds(1)]];
 }