예제 #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());
     });
 }
 public function test_getLocalizedChronoNPE()
 {
     TestHelper::assertNullException($this, function () {
         DateTimeFormatterBuilder::getLocalizedDateTimePattern(FormatStyle::SHORT(), FormatStyle::SHORT(), null, Locale::US());
     });
 }
 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()]];
 }