コード例 #1
0
 public function test_with_adjuster_Month_adjustedDayOfMonth()
 {
     $base = ZonedDateTime::ofDateTime(LocalDateTime::of(2012, 7, 31, 0, 0), self::ZONE_PARIS());
     $test = $base->adjust(Month::JUNE());
     $this->check($test, 2012, 6, 30, 0, 0, 0, 0, self::OFFSET_0200(), self::ZONE_PARIS());
 }
コード例 #2
0
 public function test_with_Month_noChange_equal()
 {
     $test = YearMonth::of(2008, 6);
     $this->assertEquals($test->adjust(Month::JUNE()), $test);
 }
コード例 #3
0
 public function test_with_Month_noChangeEqual()
 {
     $test = MonthDay::of(6, 30);
     $this->assertEquals($test->with(Month::JUNE()), $test);
 }
コード例 #4
0
ファイル: TCKYearTest.php プロジェクト: celest-time/prototype
 public function test_atMonth()
 {
     $test = Year::of(2008);
     $this->assertEquals($test->atMonth(Month::JUNE()), YearMonth::of(2008, 6));
 }
コード例 #5
0
 public function test_pattern_String()
 {
     $test = DateTimeFormatter::ofPattern("d MMM yyyy");
     $fmtLocale = Locale::getDefault();
     $this->assertEquals($test->format(LocalDate::of(2012, 6, 30)), "30 " . Month::JUNE()->getDisplayName(TextStyle::SHORT(), $fmtLocale) . " 2012");
     $this->assertEquals($test->getLocale(), $fmtLocale, "Locale.Category.FORMAT");
 }
コード例 #6
0
 public function test_toString()
 {
     $this->assertEquals(Month::JANUARY()->__toString(), "JANUARY");
     $this->assertEquals(Month::FEBRUARY()->__toString(), "FEBRUARY");
     $this->assertEquals(Month::MARCH()->__toString(), "MARCH");
     $this->assertEquals(Month::APRIL()->__toString(), "APRIL");
     $this->assertEquals(Month::MAY()->__toString(), "MAY");
     $this->assertEquals(Month::JUNE()->__toString(), "JUNE");
     $this->assertEquals(Month::JULY()->__toString(), "JULY");
     $this->assertEquals(Month::AUGUST()->__toString(), "AUGUST");
     $this->assertEquals(Month::SEPTEMBER()->__toString(), "SEPTEMBER");
     $this->assertEquals(Month::OCTOBER()->__toString(), "OCTOBER");
     $this->assertEquals(Month::NOVEMBER()->__toString(), "NOVEMBER");
     $this->assertEquals(Month::DECEMBER()->__toString(), "DECEMBER");
 }