コード例 #1
0
 public function test_toString_altered()
 {
     $base = DecimalStyle::of(Locale::US())->withZeroDigit('A')->withDecimalSeparator('@');
     $this->assertEquals($base->__toString(), "DecimalStyle[A+-@]");
 }
コード例 #2
0
 public function test_getText_nullStyle()
 {
     TestHelper::assertNullException($this, function () {
         DayOfWeek::MONDAY()->getDisplayName(null, Locale::US());
     });
 }
コード例 #3
0
 /**
  * @dataProvider data_formatStyle
  */
 public function test_formatStyle(Temporal $temporal, FormatStyle $style, $formattedStr)
 {
     $this->markTestIncomplete('ZoneTextPrinterParser, Localized Zone Names');
     $builder = new DateTimeFormatterBuilder();
     $formatter = $builder->appendLocalized($style, $style)->appendLiteral(" ")->appendZoneOrOffsetId()->toFormatter();
     $formatter = $formatter->withLocale(Locale::US());
     $this->assertEquals($formattedStr, $formatter->format($temporal));
 }
コード例 #4
0
 function providerDayOfWeekData()
 {
     return [[Locale::US(), "e", "1", DayOfWeek::SUNDAY()], [Locale::US(), "ee", "01", DayOfWeek::SUNDAY()], [Locale::US(), "c", "1", DayOfWeek::SUNDAY()], [Locale::UK(), "e", "1", DayOfWeek::MONDAY()], [Locale::UK(), "ee", "01", DayOfWeek::MONDAY()], [Locale::UK(), "c", "1", DayOfWeek::MONDAY()]];
 }
コード例 #5
0
 public function test_WeekFields_week_based_year()
 {
     $locale = Locale::US();
     $weekOfYearField = WeekFields::SUNDAY_START()->weekOfYear();
     $name = $weekOfYearField->getDisplayName($locale);
     $this->assertEquals(TestHelper::getEnglishWeek(), $name, TestHelper::INTLinfo($locale->getLocale()));
 }
コード例 #6
0
 public function test_getText_nullStyle()
 {
     TestHelper::assertNullException($this, function () {
         Month::JANUARY()->getDisplayName(null, Locale::US());
     });
 }
コード例 #7
0
 public function test_getLocalizedChronoNPE()
 {
     TestHelper::assertNullException($this, function () {
         DateTimeFormatterBuilder::getLocalizedDateTimePattern(FormatStyle::SHORT(), FormatStyle::SHORT(), null, Locale::US());
     });
 }
コード例 #8
0
 function data_time()
 {
     return [[LocalTime::of(11, 30), FormatStyle::SHORT(), \IntlDateFormatter::SHORT, Locale::UK()], [LocalTime::of(11, 30), FormatStyle::SHORT(), \IntlDateFormatter::SHORT, Locale::US()], [LocalTime::of(11, 30), FormatStyle::SHORT(), \IntlDateFormatter::SHORT, Locale::FRANCE()], [LocalTime::of(11, 30), FormatStyle::SHORT(), \IntlDateFormatter::SHORT, Locale::JAPAN()], [LocalTime::of(11, 30), FormatStyle::MEDIUM(), \IntlDateFormatter::MEDIUM, Locale::UK()], [LocalTime::of(11, 30), FormatStyle::MEDIUM(), \IntlDateFormatter::MEDIUM, Locale::US()], [LocalTime::of(11, 30), FormatStyle::MEDIUM(), \IntlDateFormatter::MEDIUM, Locale::FRANCE()], [LocalTime::of(11, 30), FormatStyle::MEDIUM(), \IntlDateFormatter::MEDIUM, Locale::JAPAN()]];
 }