Exemplo n.º 1
0
 public function test_factory_intMonth_nullMonth()
 {
     TestHelper::assertNullException($this, function () {
         MonthDay::ofMonth(null, 15);
     });
 }
Exemplo n.º 2
0
 /**
  * Obtains the current month-day from the specified clock.
  * <p>
  * This will query the specified clock to obtain the current month-day.
  * Using this method allows the use of an alternate clock for testing.
  * The alternate clock may be introduced using {@link Clock dependency injection}.
  *
  * @param Clock $clock the clock to use, not null
  * @return MonthDay the current month-day, not null
  */
 public static function nowOf(Clock $clock)
 {
     $now = LocalDate::nowOf($clock);
     // called once
     return MonthDay::ofMonth($now->getMonth(), $now->getDayOfMonth());
 }