Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace yiiunit\framework\helpers; use Yii; use yii\helpers\FormatConverter; use ..

Decoded Output download

<?php
 namespace yiiunit\framework\helpers; use Yii; use yii\helpers\FormatConverter; use yii\i18n\Formatter; use yiiunit\framework\i18n\IntlTestHelper; use yiiunit\TestCase; class FormatConverterTest extends TestCase { protected function setUp() : void { parent::setUp(); IntlTestHelper::setIntlStatus($this); $this->mockApplication(array("timeZone" => "UTC", "language" => "ru-RU")); } protected function tearDown() : void { parent::tearDown(); IntlTestHelper::resetIntlStatus(); } public function testIntlIcuToPhpShortForm() { $this->assertEqualsAnyWhitespace("n/j/y", FormatConverter::convertDateIcuToPhp("short", "date", "en-US")); $this->assertEqualsAnyWhitespace("d.m.y", FormatConverter::convertDateIcuToPhp("short", "date", "de-DE")); } public function testIntlIcuToPhpShortFormDefaultLang() { Yii::$app->language = "en"; $this->assertEquals("n/j/y", FormatConverter::convertDateIcuToPhp("short", "date")); Yii::$app->language = "de"; $this->assertEquals("d.m.y", FormatConverter::convertDateIcuToPhp("short", "date")); } public function testIntlIcuToPhpShortFormTime() { $this->assertEqualsAnyWhitespace("g:i A", FormatConverter::convertDateIcuToPhp("short", "time", "en-US")); $this->assertEqualsAnyWhitespace("H:i", FormatConverter::convertDateIcuToPhp("short", "time", "de-DE")); } public function testIntlIcuToPhpShortFormDateTime() { $this->assertEqualsAnyWhitespace("n/j/y, g:i A", FormatConverter::convertDateIcuToPhp("short", "datetime", "en-US")); $this->assertEquals(PHP_VERSION_ID < 50600 ? "d.m.y H:i" : "d.m.y, H:i", FormatConverter::convertDateIcuToPhp("short", "datetime", "de-DE")); } public function testEscapedIcuToPhpMixedPatterns() { $this->assertEquals("l, F j, Y \a\t g:i:s A T", FormatConverter::convertDateIcuToPhp("EEEE, MMMM d, y 'at' h:mm:ss a zzzz")); $this->assertEquals("\o\'\c\l\o\c\k", FormatConverter::convertDateIcuToPhp("'o''clock'")); } public function providerForICU2PHPPatterns() { return array("two single quotes produce one" => array("''", "\'"), "era designator like (Anno Domini)" => array("G", ''), "4digit year of "Week of Year"" => array("Y", "o"), "4digit year #1" => array("y", "Y"), "4digit year #2" => array("yyyy", "Y"), "2digit year number" => array("yy", "y"), "extended year e.g. 4601" => array("u", ''), "cyclic year name, as in Chinese lunar calendar" => array("U", ''), "related Gregorian year e.g. 1996" => array("r", ''), "number of quarter" => array("Q", ''), "number of quarter "02"" => array("QQ", ''), "quarter "Q2"" => array("QQQ", ''), "quarter 2nd quarter" => array("QQQQ", ''), "number of quarter 2" => array("QQQQQ", ''), "number of Stand Alone quarter" => array("q", ''), "number of Stand Alone quarter "02"" => array("qq", ''), "Stand Alone quarter "Q2"" => array("qqq", ''), "Stand Alone quarter "2nd quarter"" => array("qqqq", ''), "number of Stand Alone quarter "2"" => array("qqqqq", ''), "Numeric representation of a month, without leading zeros" => array("M", "n"), "Numeric representation of a month, with leading zeros" => array("MM", "m"), "A short textual representation of a month, three letters" => array("MMM", "M"), "A full textual representation of a month, such as January or March" => array("MMMM", "F"), "MMMMM" => array("MMMMM", ''), "Stand alone month in year #1" => array("L", "n"), "Stand alone month in year #2" => array("LL", "m"), "Stand alone month in year #3" => array("LLL", "M"), "Stand alone month in year #4" => array("LLLL", "F"), "Stand alone month in year #5" => array("LLLLL", ''), "ISO-8601 week number of year #1" => array("w", "W"), "ISO-8601 week number of year #2" => array("ww", "W"), "week of the current month" => array("W", ''), "day without leading zeros" => array("d", "j"), "day with leading zeros" => array("dd", "d"), "day of the year 0 to 365" => array("D", "z"), "Day of Week in Month. eg. 2nd Wednesday in July" => array("F", ''), "Modified Julian day. This is different from the conventional Julian day number in two regards." => array("g", ''), "day of week written in short form eg. Sun" => array("E", "D"), "EE" => array("EE", "D"), "EEE" => array("EEE", "D"), "day of week fully written eg. Sunday" => array("EEEE", "l"), "EEEEE" => array("EEEEE", ''), "EEEEEE" => array("EEEEEE", ''), "ISO-8601 numeric representation of the day of the week 1=Mon to 7=Sun #1" => array("e", "N"), "php "w" 0=Sun to 6=Sat isn`t supported by ICU -> "w" means week number of year #1" => array("ee", "N"), "eee" => array("eee", "D"), "eeee" => array("eeee", "l"), "eeeee" => array("eeeee", ''), "eeeeee" => array("eeeeee", ''), "ISO-8601 numeric representation of the day of the week 1=Mon to 7=Sun #2" => array("c", "N"), "php "w" 0=Sun to 6=Sat isn`t supported by ICU -> "w" means week number of year #2" => array("cc", "N"), "ccc" => array("ccc", "D"), "cccc" => array("cccc", "l"), "ccccc" => array("ccccc", ''), "cccccc" => array("cccccc", ''), "AM/PM marker" => array("a", "A"), "12-hour format of an hour without leading zeros 1 to 12h" => array("h", "g"), "12-hour format of an hour with leading zeros, 01 to 12 h" => array("hh", "h"), "24-hour format of an hour without leading zeros 0 to 23h" => array("H", "G"), "24-hour format of an hour with leading zeros, 00 to 23 h" => array("HH", "H"), "hour in day (1~24) #1" => array("k", ''), "hour in day (1~24) #2" => array("kk", ''), "hour in am/pm (0~11) #1" => array("K", ''), "hour in am/pm (0~11) #2" => array("KK", ''), "Minutes without leading zeros, not supported by php but we fallback" => array("m", "i"), "Minutes with leading zeros" => array("mm", "i"), "Seconds, without leading zeros, not supported by php but we fallback" => array("s", "s"), "Seconds, with leading zeros" => array("ss", "s"), "fractional second #1" => array("S", ''), "fractional second #2" => array("SS", ''), "fractional second #3" => array("SSS", ''), "fractional second #4" => array("SSSS", ''), "milliseconds in day" => array("A", ''), "Timezone abbreviation #1" => array("z", "T"), "Timezone abbreviation #2" => array("zz", "T"), "Timezone abbreviation #3" => array("zzz", "T"), "Timezone full name, not supported by php but we fallback" => array("zzzz", "T"), "Difference to Greenwich time (GMT) in hours #1" => array("Z", "O"), "Difference to Greenwich time (GMT) in hours #2" => array("ZZ", "O"), "Difference to Greenwich time (GMT) in hours #3" => array("ZZZ", "O"), "Time Zone: long localized GMT (=OOOO) e.g. GMT-08:00" => array("ZZZZ", "\G\M\TP"), "TIme Zone: ISO8601 extended hms? (=XXXXX)" => array("ZZZZZ", ''), "Time Zone: short localized GMT e.g. GMT-8" => array("O", ''), "Time Zone: long localized GMT (=ZZZZ) e.g. GMT-08:00" => array("OOOO", "\G\M\TP"), "Time Zone: generic non-location (falls back first to VVVV and then to OOOO) using the ICU defined fallback here #1" => array("v", "\G\M\TP"), "Time Zone: generic non-location (falls back first to VVVV and then to OOOO) using the ICU defined fallback here #2" => array("vvvv", "\G\M\TP"), "Time Zone: short time zone ID" => array("V", ''), "Time Zone: long time zone ID" => array("VV", "e"), "Time Zone: time zone exemplar city" => array("VVV", ''), "Time Zone: generic location (falls back to OOOO) using the ICU defined fallback here" => array("VVVV", "\G\M\TP"), "Time Zone: ISO8601 basic hm?, with Z for 0, e.g. -08, +0530, Z" => array("X", ''), "Time Zone: ISO8601 basic hm, with Z, e.g. -0800, Z" => array("XX", "O, \Z"), "Time Zone: ISO8601 extended hm, with Z, e.g. -08:00, Z" => array("XXX", "P, \Z"), "Time Zone: ISO8601 basic hms?, with Z, e.g. -0800, -075258, Z" => array("XXXX", ''), "Time Zone: ISO8601 extended hms?, with Z, e.g. -08:00, -07:52:58, Z" => array("XXXXX", ''), "Time Zone: ISO8601 basic hm?, without Z for 0, e.g. -08, +0530" => array("x", ''), "Time Zone: ISO8601 basic hm, without Z, e.g. -0800" => array("xx", "O"), "Time Zone: ISO8601 extended hm, without Z, e.g. -08:00" => array("xxx", "P"), "Time Zone: ISO8601 basic hms?, without Z, e.g. -0800, -075258" => array("xxxx", ''), "Time Zone: ISO8601 extended hms?, without Z, e.g. -08:00, -07:52:58" => array("xxxxx", '')); } public function testEscapedIcuToPhpSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDateIcuToPhp($pattern)); } public function testEscapedIcuToJui() { $this->assertEquals("DD, MM d, yy 'at' ", FormatConverter::convertDateIcuToJui("EEEE, MMMM d, y 'at' zzzz")); $this->assertEquals("'o''clock'", FormatConverter::convertDateIcuToJui("'o''clock'")); } public function testIntlIcuToJuiShortForm() { $this->assertEquals("m/d/y", FormatConverter::convertDateIcuToJui("short", "date", "en-US")); $this->assertEquals("dd.mm.y", FormatConverter::convertDateIcuToJui("short", "date", "de-DE")); } public function testIntlIcuToJuiShortFormDefaultLang() { Yii::$app->language = "en"; $this->assertEquals("m/d/y", FormatConverter::convertDateIcuToJui("short", "date")); Yii::$app->language = "de"; $this->assertEquals("dd.mm.y", FormatConverter::convertDateIcuToJui("short", "date")); } public function testIntlIcuToJuiShortFormTime() { $this->assertEqualsAnyWhitespace(": ", FormatConverter::convertDateIcuToJui("short", "time", "en-US")); $this->assertEqualsAnyWhitespace(":", FormatConverter::convertDateIcuToJui("short", "time", "de-DE")); } public function testIntlIcuToJuiShortFormDateTime() { $this->assertEqualsAnyWhitespace("m/d/y, : ", FormatConverter::convertDateIcuToJui("short", "datetime", "en-US")); $this->assertEquals(PHP_VERSION_ID < 50600 ? "dd.mm.y :" : "dd.mm.y, :", FormatConverter::convertDateIcuToJui("short", "datetime", "de-DE")); } public function providerForICU2JUIPatterns() { return array("era designator like (Anno Domini)" => array("G", ''), "4digit year of "Week of Year"" => array("Y", ''), "4digit year e.g. 2014 #1" => array("y", "yy"), "4digit year e.g. 2014 #2" => array("yyyy", "yy"), "2digit year number eg. 14" => array("yy", "y"), "extended year e.g. 4601" => array("u", ''), "cyclic year name, as in Chinese lunar calendar" => array("U", ''), "related Gregorian year e.g. 1996" => array("r", ''), "number of quarter" => array("Q", ''), "number of quarter "02"" => array("QQ", ''), "quarter "Q2"" => array("QQQ", ''), "quarter "2nd quarter"" => array("QQQQ", ''), "number of quarter "2"" => array("QQQQQ", ''), "number of Stand Alone quarter" => array("q", ''), "number of Stand Alone quarter "02"" => array("qq", ''), "Stand Alone quarter "Q2"" => array("qqq", ''), "Stand Alone quarter "2nd quarter"" => array("qqqq", ''), "number of Stand Alone quarter "2"" => array("qqqqq", ''), "Numeric representation of a month, without leading zeros" => array("M", "m"), "Numeric representation of a month, with leading zeros" => array("MM", "mm"), "A short textual representation of a month, three letters" => array("MMM", "M"), "A full textual representation of a month, such as January or March" => array("MMMM", "MM"), "MMMMM" => array("MMMMM", ''), "Stand alone month in year #1" => array("L", "m"), "Stand alone month in year #2" => array("LL", "mm"), "Stand alone month in year #3" => array("LLL", "M"), "Stand alone month in year #4" => array("LLLL", "MM"), "Stand alone month in year #5" => array("LLLLL", ''), "ISO-8601 week number of year #1" => array("w", ''), "ISO-8601 week number of year #2" => array("ww", ''), "week of the current month" => array("W", ''), "day without leading zeros" => array("d", "d"), "day with leading zeros" => array("dd", "dd"), "day of the year 0 to 365" => array("D", "o"), "Day of Week in Month. eg. 2nd Wednesday in July" => array("F", ''), "Modified Julian day. This is different from the conventional Julian day number in two regards." => array("g", ''), "day of week written in short form eg. Sun" => array("E", "D"), "EE" => array("EE", "D"), "EEE" => array("EEE", "D"), "day of week fully written eg. Sunday" => array("EEEE", "DD"), "EEEEE" => array("EEEEE", ''), "EEEEEE" => array("EEEEEE", ''), "ISO-8601 numeric representation of the day of the week 1=Mon to 7=Sun #1" => array("e", ''), "php "w" 0=Sun to 6=Sat isn`t supported by ICU -> "w" means week number of year #1" => array("ee", ''), "eee" => array("eee", "D"), "eeee" => array("eeee", ''), "eeeee" => array("eeeee", ''), "eeeeee" => array("eeeeee", ''), "ISO-8601 numeric representation of the day of the week 1=Mon to 7=Sun #2" => array("c", ''), "php "w" 0=Sun to 6=Sat isn`t supported by ICU -> "w" means week number of year #2" => array("cc", ''), "ccc" => array("ccc", "D"), "cccc" => array("cccc", "DD"), "ccccc" => array("ccccc", ''), "cccccc" => array("cccccc", ''), "am/pm marker" => array("a", ''), "12-hour format of an hour without leading zeros 1 to 12h" => array("h", ''), "12-hour format of an hour with leading zeros, 01 to 12 h" => array("hh", ''), "24-hour format of an hour without leading zeros 0 to 23h" => array("H", ''), "24-hour format of an hour with leading zeros, 00 to 23 h" => array("HH", ''), "hour in day (1~24) #1" => array("k", ''), "hour in day (1~24) #2" => array("kk", ''), "hour in am/pm (0~11) #1" => array("K", ''), "hour in am/pm (0~11) #2" => array("KK", ''), "Minutes without leading zeros, not supported by php but we fallback" => array("m", ''), "Minutes with leading zeros" => array("mm", ''), "Seconds, without leading zeros, not supported by php but we fallback" => array("s", ''), "Seconds, with leading zeros" => array("ss", ''), "fractional second #1" => array("S", ''), "fractional second #2" => array("SS", ''), "fractional second #3" => array("SSS", ''), "fractional second #4" => array("SSSS", ''), "milliseconds in day" => array("A", ''), "Timezone abbreviation #1" => array("z", ''), "Timezone abbreviation #2" => array("zz", ''), "Timezone abbreviation #3" => array("zzz", ''), "Timezone full name, not supported by php but we fallback" => array("zzzz", ''), "Difference to Greenwich time (GMT) in hours #1" => array("Z", ''), "Difference to Greenwich time (GMT) in hours #2" => array("ZZ", ''), "Difference to Greenwich time (GMT) in hours #3" => array("ZZZ", ''), "Time Zone: long localized GMT (=OOOO) e.g. GMT-08:00" => array("ZZZZ", ''), "Time Zone: ISO8601 extended hms? (=XXXXX)" => array("ZZZZZ", ''), "Time Zone: short localized GMT e.g. GMT-8" => array("O", ''), "Time Zone: long localized GMT (=ZZZZ) e.g. GMT-08:00" => array("OOOO", ''), "Time Zone: generic non-location (falls back first to VVVV and then to OOOO) using the ICU defined fallback here #1" => array("v", ''), "Time Zone: generic non-location (falls back first to VVVV and then to OOOO) using the ICU defined fallback here #2" => array("vvvv", ''), "Time Zone: short time zone ID" => array("V", ''), "Time Zone: long time zone ID" => array("VV", ''), "Time Zone: time zone exemplar city" => array("VVV", ''), "Time Zone: generic location (falls back to OOOO) using the ICU defined fallback here" => array("VVVV", ''), "Time Zone: ISO8601 basic hm?, with Z for 0, e.g. -08, +0530, Z" => array("X", ''), "Time Zone: ISO8601 basic hm, with Z, e.g. -0800, Z" => array("XX", ''), "Time Zone: ISO8601 extended hm, with Z, e.g. -08:00, Z" => array("XXX", ''), "Time Zone: ISO8601 basic hms?, with Z, e.g. -0800, -075258, Z" => array("XXXX", ''), "Time Zone: ISO8601 extended hms?, with Z, e.g. -08:00, -07:52:58, Z" => array("XXXXX", ''), "Time Zone: ISO8601 basic hm?, without Z for 0, e.g. -08, +0530" => array("x", ''), "Time Zone: ISO8601 basic hm, without Z, e.g. -0800" => array("xx", ''), "Time Zone: ISO8601 extended hm, without Z, e.g. -08:00" => array("xxx", ''), "Time Zone: ISO8601 basic hms?, without Z, e.g. -0800, -075258" => array("xxxx", ''), "Time Zone: ISO8601 extended hms?, without Z, e.g. -08:00, -07:52:58" => array("xxxxx", '')); } public function testEscapedIcuToJuiSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDateIcuToJui($pattern)); } public function testIntlOneDigitIcu() { $formatter = new Formatter(array("locale" => "en-US")); $this->assertEquals("24.8.2014", $formatter->asDate("2014-8-24", "php:d.n.Y")); $this->assertEquals("24.8.2014", $formatter->asDate("2014-8-24", "d.M.yyyy")); $this->assertEquals("24.8.2014", $formatter->asDate("2014-8-24", "d.L.yyyy")); } public function testOneDigitIcu() { $formatter = new Formatter(array("locale" => "en-US")); $this->assertEquals("24.8.2014", $formatter->asDate("2014-8-24", "php:d.n.Y")); $this->assertEquals("24.8.2014", $formatter->asDate("2014-8-24", "d.M.yyyy")); $this->assertEquals("24.8.2014", $formatter->asDate("2014-8-24", "d.L.yyyy")); } public function testIntlUtf8Ru() { $this->assertEquals("d M Y \\xd0\263.", FormatConverter::convertDateIcuToPhp("dd MMM y '\xd0\263'.", "date", "ru-RU")); $this->assertEquals("dd M yy '\320\xb3'.", FormatConverter::convertDateIcuToJui("dd MMM y '\320\xb3'.", "date", "ru-RU")); $formatter = new Formatter(array("locale" => "ru-RU")); $this->assertMatchesRegularExpression("/24 \xd0\xb0\xd0\xb2\xd0\xb3\.? 2014 \320\263\./", $formatter->asDate("2014-8-24", "dd MMM y '\320\xb3'.")); } public function testPhpToICUMixedPatterns() { $expected = "yyyy-MM-dd'T'HH:mm:ssxxx"; $actual = FormatConverter::convertDatePhpToIcu("Y-m-d\TH:i:sP"); $this->assertEquals($expected, $actual); $expected = "yyyy-MM-dd'Yii'HH:mm:ssxxx"; $actual = FormatConverter::convertDatePhpToIcu("Y-m-d\Y\i\iH:i:sP"); $this->assertEquals($expected, $actual); $expected = "yyyy-MM-dd'Yii'HH:mm:ssxxx''''"; $actual = FormatConverter::convertDatePhpToIcu("Y-m-d\Y\i\iH:i:sP''"); $this->assertEquals($expected, $actual); $expected = "yyyy-MM-dd'Yii'\HH:mm:ssxxx''''"; $actual = FormatConverter::convertDatePhpToIcu("Y-m-d\Y\i\i\\H:i:sP''"); $this->assertEquals($expected, $actual); $expected = "'dDjlNSwZWFmMntLoYyaBghHisueIOPTZcru'"; $actual = FormatConverter::convertDatePhpToIcu("\d\D\j\l\N\S\w\Z\W\F\m\M\n\t\L\o\Y\y\a\B\g\h\H\i\s\u\e\I\O\P\T\Z\c\r\u"); $this->assertEquals($expected, $actual); $expected = "yyyy-MM-dd'T'HH:mm:ssxxx"; $actual = FormatConverter::convertDatePhpToIcu("c"); $this->assertEquals($expected, $actual); } public function providerForPHP2ICUPatterns() { return array("single ' should be encoded as '', which internally should be encoded as ''''" => array("'", "''"), "\d" => array("\d", "'d'"), "Day of the month, 2 digits with leading zeros 01 to 31" => array("d", "dd"), "\D" => array("\D", "'D'"), "A textual representation of a day, three letters Mon through Sun" => array("D", "eee"), "\j" => array("\j", "'j'"), "Day of the month without leading zeros 1 to 31" => array("j", "d"), "\l" => array("\l", "'l'"), "A full textual representation of the day of the week Sunday through Saturday" => array("l", "eeee"), "\N" => array("\N", "'N'"), "ISO-8601 numeric representation of the day of the week, 1 (for Monday) through 7 (for Sunday)" => array("N", "e"), "\S" => array("\S", "'S'"), "English ordinal suffix for the day of the month, 2 characters \x9st, nd, rd or th. Works well with j" => array("S", ''), "\w" => array("\w", "'w'"), "Numeric representation of the day of the week \x90 (for Sunday) through 6 (for Saturday)" => array("w", ''), "\z" => array("\z", "'z'"), "The day of the year (starting from 0) 0 through 365" => array("z", "D"), "\W" => array("\W", "'W'"), "ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year)" => array("W", "w"), "\F" => array("\F", "'F'"), "A full textual representation of a month, January through December" => array("F", "MMMM"), "\m" => array("\m", "'m'"), "Numeric representation of a month, with leading zeros 01 through 12" => array("m", "MM"), "\M" => array("\M", "'M'"), "A short textual representation of a month, three letters Jan through Dec" => array("M", "MMM"), "\n" => array("\n", "'n'"), "Numeric representation of a month, without leading zeros 1 through 12, not supported by ICU but we fallback to "with leading zero"" => array("n", "M"), "\t" => array("\t", "'t'"), "Number of days in the given month 28 through 31" => array("t", ''), "\L" => array("\L", "'L'"), "Whether it`s a leap year, 1 if it is a leap year, 0 otherwise." => array("L", ''), "\o" => array("\o", "'o'"), "ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead." => array("o", "Y"), "\Y" => array("\Y", "'Y'"), "A full numeric representation of a year, 4 digits Examples: 1999 or 2003" => array("Y", "yyyy"), "\y" => array("\y", "'y'"), "A two digit representation of a year Examples: 99 or 03" => array("y", "yy"), "\a" => array("\a", "'a'"), "Lowercase Ante meridiem and Post meridiem, am or pm" => array("a", "a"), "\A" => array("\A", "'A'"), "Uppercase Ante meridiem and Post meridiem, AM or PM, not supported by ICU but we fallback to lowercase" => array("A", "a"), "\B" => array("\B", "'B'"), "\A\B" => array("\A\B", "'AB'"), "Swatch Internet time 000 through 999" => array("B", ''), "\g" => array("\g", "'g'"), "12-hour format of an hour without leading zeros 1 through 12" => array("g", "h"), "\G" => array("\G", "'G'"), "24-hour format of an hour without leading zeros 0 to 23h" => array("G", "H"), "\h" => array("\h", "'h'"), "12-hour format of an hour with leading zeros, 01 to 12 h" => array("h", "hh"), "\H" => array("\H", "'H'"), "24-hour format of an hour with leading zeros, 00 to 23 h" => array("H", "HH"), "\i" => array("\i", "'i'"), "Minutes with leading zeros 00 to 59" => array("i", "mm"), "\s" => array("\s", "'s'"), "Seconds, with leading zeros 00 through 59" => array("s", "ss"), "\u" => array("\u", "'u'"), "Microseconds. Example: 654321" => array("u", ''), "\e" => array("\e", "'e'"), "Timezone identifier. Examples: UTC, GMT, Atlantic/Azores" => array("e", "VV"), "\I" => array("\I", "'I'"), "Whether or not the date is in daylight saving time, 1 if Daylight Saving Time, 0 otherwise." => array("I", ''), "\O" => array("\O", "'O'"), "Difference to Greenwich time (GMT) in hours, Example: +0200" => array("O", "xx"), "\P" => array("\P", "'P'"), "Difference to Greenwich time (GMT) with colon between hours and minutes, Example: +02:00" => array("P", "xxx"), "\T" => array("\T", "'T'"), "Timezone abbreviation, Examples: EST, MDT ..." => array("T", "zzz"), "\Z" => array("\Z", "'Z'"), "Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. -43200 through 50400" => array("Z", ''), "\c" => array("\c", "'c'"), "ISO 8601 date, e.g. 2004-02-12T15:19:21+00:00" => array("c", "yyyy-MM-dd'T'HH:mm:ssxxx"), "\r" => array("\r", "'r'"), "RFC 2822 formatted date, Example: Thu, 21 Dec 2000 16:01:07 +0200" => array("r", "eee, dd MMM yyyy HH:mm:ss xx"), "\U" => array("\U", "'U'"), "Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)" => array("U", ''), "\" => array("\\", "\")); } public function testPhpToICUSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDatePhpToIcu($pattern)); } public function testPhpFormatC() { $time = time(); $formatter = new Formatter(array("locale" => "en-US")); $this->assertEquals(date("c", $time), $formatter->asDatetime($time, "php:c")); date_default_timezone_set("Europe/Moscow"); $formatter = new Formatter(array("locale" => "ru-RU", "timeZone" => "Europe/Moscow")); $this->assertEquals(date("c", $time), $formatter->asDatetime($time, "php:c")); } public function testEscapedPhpToJuiMixedPatterns() { $this->assertEquals("dd-mm-yy", FormatConverter::convertDatePhpToJui("d-m-Y")); } public function providerForPHP2JUIPatterns() { return array("Day of the month, 2 digits with leading zeros \x901 to 31" => array("d", "dd"), "A textual representation of a day, three letters 	Mon through Sun" => array("D", "D"), "Day of the month without leading zeros 1 to 31" => array("j", "d"), "A full textual representation of the day of the week Sunday through Saturday" => array("l", "DD"), "ISO-8601 numeric representation of the day of the week, 1 (for Monday) through 7 (for Sunday)" => array("N", ''), "English ordinal suffix for the day of the month, 2 characters 	st, nd, rd or th. Works well with j" => array("S", ''), "Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)" => array("w", ''), "The day of the year (starting from 0) 0 through 365" => array("z", "o"), "ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year)" => array("W", ''), "A full textual representation of a month, January through December" => array("F", "MM"), "Numeric representation of a month, with leading zeros 01 through 12" => array("m", "mm"), "A short textual representation of a month, three letters Jan through Dec" => array("M", "M"), "Numeric representation of a month, without leading zeros 1 through 12" => array("n", "m"), "Number of days in the given month 	28 through 31" => array("t", ''), "Whether it`s a leap year, 1 if it is a leap year, 0 otherwise." => array("L", ''), "ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead." => array("o", ''), "A full numeric representation of a year, 4 digits 	Examples: 1999 or 2003" => array("Y", "yy"), "A two digit representation of a year Examples: 99 or 03" => array("y", "y"), "Lowercase Ante meridiem and Post meridiem, am or pm" => array("a", ''), "Uppercase Ante meridiem and Post meridiem, AM or PM, not supported by ICU but we fallback to lowercase" => array("A", ''), "Swatch Internet time 000 through 999" => array("B", ''), "12-hour format of an hour without leading zeros 1 through 12" => array("g", ''), "24-hour format of an hour without leading zeros 0 to 23h" => array("G", ''), "12-hour format of an hour with leading zeros, 01 to 12 h" => array("h", ''), "24-hour format of an hour with leading zeros, 00 to 23 h" => array("H", ''), "Minutes with leading zeros 00 to 59" => array("i", ''), "Seconds, with leading zeros 00 through 59" => array("s", ''), "Microseconds. Example: 654321" => array("u", ''), "Timezone identifier. Examples: UTC, GMT, Atlantic/Azores" => array("e", ''), "Whether or not the date is in daylight saving time, 1 if Daylight Saving Time, 0 otherwise." => array("I", ''), "Difference to Greenwich time (GMT) in hours, Example: +0200" => array("O", ''), "Difference to Greenwich time (GMT) with colon between hours and minutes, Example: +02:00" => array("P", ''), "Timezone abbreviation, Examples: EST, MDT ..." => array("T", ''), "Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. -43200 through 50400" => array("Z", ''), "ISO 8601 date, e.g. 2004-02-12T15:19:21+00:00, skipping the time here because it is not supported" => array("c", "yyyy-MM-dd"), "RFC 2822 formatted date, Example: Thu, 21 Dec 2000 16:01:07 +0200, skipping the time here because it is not supported" => array("r", "D, d M yy"), "Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)" => array("U", "@")); } public function testEscapedPhpToJuiSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDatePhpToJui($pattern)); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace yiiunit\framework\helpers; use Yii; use yii\helpers\FormatConverter; use yii\i18n\Formatter; use yiiunit\framework\i18n\IntlTestHelper; use yiiunit\TestCase; class FormatConverterTest extends TestCase { protected function setUp() : void { parent::setUp(); IntlTestHelper::setIntlStatus($this); $this->mockApplication(array("\x74\x69\155\145\132\157\156\x65" => "\x55\124\x43", "\154\x61\156\147\x75\141\x67\145" => "\162\165\55\x52\125")); } protected function tearDown() : void { parent::tearDown(); IntlTestHelper::resetIntlStatus(); } public function testIntlIcuToPhpShortForm() { $this->assertEqualsAnyWhitespace("\156\x2f\x6a\x2f\x79", FormatConverter::convertDateIcuToPhp("\x73\x68\157\162\164", "\144\x61\x74\145", "\145\156\x2d\125\x53")); $this->assertEqualsAnyWhitespace("\144\56\155\56\x79", FormatConverter::convertDateIcuToPhp("\163\150\157\162\x74", "\x64\141\164\x65", "\x64\x65\x2d\104\105")); } public function testIntlIcuToPhpShortFormDefaultLang() { Yii::$app->language = "\145\156"; $this->assertEquals("\156\x2f\152\57\x79", FormatConverter::convertDateIcuToPhp("\x73\x68\x6f\162\164", "\x64\x61\x74\x65")); Yii::$app->language = "\144\x65"; $this->assertEquals("\144\x2e\x6d\x2e\x79", FormatConverter::convertDateIcuToPhp("\163\x68\x6f\162\164", "\x64\x61\164\x65")); } public function testIntlIcuToPhpShortFormTime() { $this->assertEqualsAnyWhitespace("\147\x3a\x69\40\x41", FormatConverter::convertDateIcuToPhp("\x73\150\x6f\x72\x74", "\164\151\x6d\x65", "\145\156\x2d\x55\123")); $this->assertEqualsAnyWhitespace("\x48\72\x69", FormatConverter::convertDateIcuToPhp("\163\150\157\x72\164", "\164\x69\x6d\145", "\144\145\55\104\x45")); } public function testIntlIcuToPhpShortFormDateTime() { $this->assertEqualsAnyWhitespace("\x6e\57\x6a\x2f\x79\x2c\40\147\72\151\40\x41", FormatConverter::convertDateIcuToPhp("\x73\150\x6f\162\x74", "\x64\141\x74\145\164\151\x6d\145", "\145\x6e\x2d\125\x53")); $this->assertEquals(PHP_VERSION_ID < 50600 ? "\144\56\x6d\56\x79\x20\x48\x3a\x69" : "\144\56\x6d\56\171\54\x20\x48\x3a\151", FormatConverter::convertDateIcuToPhp("\163\150\x6f\x72\164", "\144\x61\x74\x65\164\151\155\x65", "\x64\x65\x2d\x44\105")); } public function testEscapedIcuToPhpMixedPatterns() { $this->assertEquals("\154\54\x20\x46\40\x6a\x2c\40\131\40\x5c\x61\x5c\164\x20\147\x3a\x69\72\163\40\x41\40\124", FormatConverter::convertDateIcuToPhp("\x45\x45\x45\x45\54\x20\115\115\115\x4d\x20\x64\x2c\40\x79\40\47\141\164\47\x20\150\x3a\x6d\155\72\x73\163\x20\x61\40\172\x7a\172\x7a")); $this->assertEquals("\x5c\157\134\47\134\x63\134\x6c\134\157\x5c\x63\134\153", FormatConverter::convertDateIcuToPhp("\x27\x6f\47\x27\143\x6c\x6f\x63\153\x27")); } public function providerForICU2PHPPatterns() { return array("\x74\167\157\40\163\x69\x6e\147\154\x65\40\x71\165\157\x74\x65\x73\40\x70\x72\157\x64\165\143\x65\x20\157\156\x65" => array("\47\47", "\134\x27"), "\x65\x72\141\40\144\x65\163\151\x67\156\141\164\x6f\x72\40\x6c\x69\x6b\145\x20\50\x41\156\156\157\40\104\x6f\x6d\x69\156\x69\x29" => array("\107", ''), "\64\x64\x69\x67\x69\x74\x20\171\x65\141\162\40\x6f\146\40\42\x57\x65\x65\x6b\x20\x6f\x66\x20\x59\145\141\162\x22" => array("\131", "\157"), "\x34\144\x69\x67\151\x74\40\171\x65\x61\162\x20\x23\x31" => array("\x79", "\x59"), "\x34\144\x69\147\x69\x74\x20\x79\145\x61\162\x20\x23\x32" => array("\171\171\171\x79", "\131"), "\62\x64\x69\x67\151\164\40\x79\145\141\x72\x20\156\x75\155\142\145\162" => array("\x79\171", "\171"), "\x65\170\164\x65\156\x64\145\144\x20\171\145\x61\162\x20\x65\56\147\56\40\x34\x36\60\x31" => array("\x75", ''), "\x63\171\x63\154\151\x63\x20\x79\x65\x61\x72\40\x6e\x61\x6d\x65\54\40\141\x73\x20\x69\x6e\x20\x43\x68\151\156\x65\163\145\x20\154\x75\156\141\162\x20\x63\141\154\x65\156\x64\x61\x72" => array("\x55", ''), "\162\x65\154\x61\164\145\144\x20\107\162\x65\147\157\162\x69\x61\156\40\171\x65\141\x72\x20\145\x2e\x67\x2e\40\61\71\71\x36" => array("\x72", ''), "\156\165\155\142\145\x72\x20\157\146\40\x71\x75\141\x72\164\145\162" => array("\121", ''), "\156\x75\x6d\x62\x65\162\x20\157\146\40\x71\165\141\x72\x74\x65\162\x20\x22\60\62\42" => array("\121\121", ''), "\x71\x75\x61\162\x74\145\x72\x20\x22\x51\62\42" => array("\121\x51\121", ''), "\x71\x75\141\162\x74\x65\162\x20\62\x6e\144\x20\161\x75\x61\x72\164\x65\162" => array("\x51\x51\121\121", ''), "\x6e\x75\x6d\x62\x65\162\40\x6f\x66\40\161\165\x61\162\164\145\162\x20\x32" => array("\121\121\121\121\x51", ''), "\x6e\165\155\142\x65\162\40\157\146\x20\123\x74\x61\156\x64\40\101\154\x6f\156\x65\40\x71\165\x61\x72\x74\x65\x72" => array("\161", ''), "\x6e\165\x6d\x62\145\162\40\157\146\40\123\x74\141\156\144\x20\x41\x6c\157\156\x65\40\161\x75\x61\162\x74\x65\162\40\42\x30\x32\42" => array("\161\161", ''), "\x53\x74\141\x6e\144\x20\101\x6c\157\x6e\x65\x20\161\165\141\162\164\x65\x72\40\x22\121\x32\42" => array("\x71\x71\161", ''), "\x53\164\x61\x6e\x64\x20\101\154\x6f\156\x65\x20\x71\165\141\x72\x74\x65\162\x20\x22\62\156\144\40\161\x75\141\x72\164\x65\162\42" => array("\x71\x71\x71\x71", ''), "\x6e\x75\155\142\x65\162\40\157\146\40\x53\x74\x61\156\x64\x20\x41\154\157\x6e\145\x20\x71\x75\141\162\x74\x65\x72\40\42\x32\42" => array("\x71\161\161\x71\161", ''), "\x4e\165\155\145\x72\151\143\x20\x72\145\x70\162\x65\163\x65\156\x74\x61\164\x69\157\156\40\157\x66\x20\x61\40\155\x6f\156\164\x68\54\40\x77\x69\x74\x68\157\x75\164\x20\154\145\141\144\x69\156\147\40\172\145\162\x6f\163" => array("\115", "\x6e"), "\116\x75\155\145\x72\x69\143\40\x72\145\160\x72\x65\x73\x65\156\164\x61\164\x69\157\x6e\x20\x6f\146\x20\141\x20\155\x6f\x6e\164\x68\54\x20\x77\x69\x74\150\x20\x6c\145\141\144\151\156\147\40\172\145\162\157\163" => array("\x4d\x4d", "\x6d"), "\101\40\x73\x68\x6f\x72\x74\40\x74\x65\170\x74\165\x61\154\40\162\x65\x70\162\x65\163\x65\156\164\141\164\151\x6f\x6e\40\157\146\x20\x61\x20\x6d\157\156\x74\150\x2c\x20\x74\150\x72\145\145\x20\x6c\x65\164\164\145\x72\163" => array("\x4d\115\115", "\x4d"), "\x41\40\x66\165\154\154\x20\x74\145\x78\164\165\141\x6c\40\x72\145\x70\162\145\163\x65\156\x74\x61\164\x69\157\x6e\40\x6f\x66\40\141\40\155\x6f\x6e\x74\150\x2c\40\x73\165\x63\x68\x20\141\x73\40\x4a\x61\x6e\165\x61\x72\171\x20\x6f\162\40\115\x61\162\x63\x68" => array("\x4d\x4d\115\115", "\x46"), "\x4d\115\x4d\x4d\115" => array("\x4d\115\115\x4d\115", ''), "\123\164\141\156\144\x20\x61\x6c\x6f\156\x65\40\x6d\157\x6e\x74\x68\x20\x69\x6e\x20\x79\145\x61\162\x20\43\x31" => array("\x4c", "\156"), "\x53\164\x61\156\x64\40\x61\x6c\x6f\x6e\x65\x20\x6d\157\156\x74\150\40\151\x6e\40\x79\x65\x61\x72\x20\x23\62" => array("\114\114", "\155"), "\123\164\141\x6e\144\x20\x61\x6c\x6f\x6e\145\40\x6d\x6f\x6e\x74\150\40\x69\156\40\171\x65\141\162\x20\x23\x33" => array("\x4c\x4c\114", "\115"), "\x53\164\141\x6e\x64\40\141\x6c\x6f\x6e\145\x20\155\157\x6e\164\150\x20\151\156\40\x79\x65\x61\x72\x20\x23\64" => array("\114\x4c\114\114", "\x46"), "\x53\x74\141\x6e\144\40\x61\154\157\156\145\40\155\x6f\156\164\150\x20\x69\156\x20\171\145\x61\x72\x20\x23\65" => array("\x4c\114\x4c\114\x4c", ''), "\111\123\117\x2d\x38\x36\x30\x31\40\167\x65\x65\x6b\40\x6e\165\155\x62\145\162\40\x6f\146\40\x79\145\x61\162\40\43\x31" => array("\167", "\x57"), "\x49\x53\x4f\x2d\70\x36\x30\61\40\x77\x65\x65\x6b\40\156\x75\155\x62\x65\x72\x20\x6f\146\40\x79\x65\x61\162\40\x23\x32" => array("\x77\167", "\x57"), "\167\145\x65\x6b\x20\157\x66\40\164\x68\x65\40\x63\165\x72\162\145\x6e\x74\x20\155\157\156\164\150" => array("\127", ''), "\144\141\x79\40\167\151\164\x68\x6f\165\164\40\x6c\145\x61\x64\x69\156\147\40\x7a\145\x72\x6f\x73" => array("\x64", "\152"), "\x64\x61\171\x20\x77\x69\164\x68\40\x6c\145\x61\x64\x69\x6e\x67\x20\172\x65\x72\157\163" => array("\144\144", "\144"), "\x64\x61\171\40\x6f\146\x20\164\x68\x65\40\171\x65\x61\x72\x20\x30\x20\x74\157\x20\x33\66\x35" => array("\104", "\x7a"), "\x44\141\171\40\157\x66\40\x57\x65\145\153\x20\x69\156\x20\x4d\157\x6e\164\x68\56\40\145\147\56\x20\x32\x6e\144\40\x57\145\144\x6e\x65\x73\x64\x61\x79\x20\x69\156\40\112\165\x6c\x79" => array("\106", ''), "\115\x6f\x64\x69\x66\151\145\x64\x20\x4a\165\x6c\x69\x61\x6e\40\144\x61\x79\x2e\40\x54\x68\x69\163\40\x69\x73\x20\x64\151\146\146\145\162\145\x6e\164\40\x66\x72\157\155\x20\x74\x68\145\x20\x63\157\x6e\x76\145\x6e\x74\x69\x6f\x6e\141\x6c\x20\112\165\x6c\x69\141\156\x20\x64\141\171\x20\156\165\155\142\x65\162\x20\151\156\x20\x74\167\157\x20\162\145\147\x61\x72\x64\x73\x2e" => array("\x67", ''), "\x64\141\x79\x20\x6f\146\x20\x77\x65\145\153\x20\167\x72\151\x74\x74\145\x6e\40\x69\x6e\x20\163\x68\x6f\x72\x74\40\x66\x6f\162\x6d\40\x65\x67\x2e\40\123\165\156" => array("\105", "\104"), "\x45\105" => array("\105\105", "\104"), "\x45\x45\105" => array("\105\105\x45", "\104"), "\x64\141\171\40\x6f\146\40\167\145\x65\x6b\40\146\165\x6c\x6c\171\x20\167\x72\x69\164\164\x65\x6e\40\x65\147\56\40\x53\x75\156\144\141\x79" => array("\105\x45\105\x45", "\154"), "\x45\x45\x45\x45\105" => array("\105\105\105\x45\105", ''), "\x45\105\105\x45\x45\105" => array("\105\105\105\x45\x45\105", ''), "\111\123\x4f\x2d\x38\x36\x30\61\40\156\165\155\x65\x72\x69\x63\40\162\x65\x70\162\145\163\x65\156\x74\x61\x74\x69\x6f\156\40\x6f\x66\40\x74\150\145\40\x64\141\171\40\x6f\146\x20\x74\x68\145\x20\167\x65\145\153\40\61\x3d\x4d\157\x6e\x20\x74\157\40\67\75\x53\x75\x6e\x20\x23\61" => array("\145", "\116"), "\x70\150\x70\x20\42\167\42\40\60\75\x53\165\x6e\x20\x74\157\40\x36\x3d\x53\x61\x74\x20\151\163\x6e\x60\164\40\x73\x75\160\160\157\162\164\145\x64\40\x62\x79\40\x49\103\x55\x20\x2d\76\40\x22\167\42\x20\155\x65\x61\x6e\163\x20\167\145\x65\153\40\x6e\165\155\142\x65\162\40\x6f\x66\x20\171\145\141\x72\x20\43\61" => array("\x65\x65", "\x4e"), "\x65\x65\145" => array("\145\145\145", "\x44"), "\145\x65\x65\145" => array("\145\x65\145\x65", "\x6c"), "\145\145\145\x65\x65" => array("\145\x65\x65\x65\145", ''), "\145\x65\x65\145\x65\x65" => array("\x65\145\x65\145\145\145", ''), "\x49\123\117\55\70\66\60\61\x20\x6e\x75\x6d\x65\162\x69\x63\40\x72\x65\x70\162\145\x73\145\x6e\164\x61\x74\151\157\x6e\40\157\146\40\x74\x68\145\40\x64\x61\x79\40\157\x66\40\164\x68\145\40\167\x65\145\153\40\x31\x3d\x4d\x6f\156\40\x74\x6f\40\x37\75\x53\165\x6e\40\x23\62" => array("\143", "\116"), "\160\x68\x70\x20\x22\167\x22\x20\x30\x3d\123\x75\156\40\164\x6f\x20\x36\75\x53\x61\164\40\x69\163\x6e\x60\164\40\x73\165\160\x70\x6f\162\x74\145\144\x20\142\x79\40\x49\x43\125\x20\55\x3e\40\x22\x77\42\x20\x6d\145\141\x6e\x73\x20\167\145\x65\x6b\40\x6e\x75\155\142\x65\x72\x20\157\x66\40\x79\x65\x61\x72\x20\x23\62" => array("\x63\x63", "\x4e"), "\143\x63\x63" => array("\x63\143\143", "\104"), "\x63\x63\143\x63" => array("\143\x63\x63\143", "\154"), "\143\143\x63\143\143" => array("\x63\143\x63\x63\143", ''), "\x63\143\143\x63\x63\143" => array("\x63\x63\143\x63\143\x63", ''), "\x41\x4d\57\x50\115\x20\155\141\162\x6b\145\x72" => array("\x61", "\101"), "\x31\x32\x2d\150\x6f\165\162\40\x66\157\162\155\141\x74\40\157\x66\x20\141\x6e\40\150\x6f\165\162\40\x77\151\164\x68\157\165\x74\40\x6c\x65\141\144\151\156\x67\x20\x7a\145\x72\157\x73\x20\61\x20\x74\x6f\40\x31\x32\150" => array("\150", "\147"), "\x31\62\x2d\x68\157\165\162\40\146\157\162\155\141\x74\40\x6f\x66\x20\x61\x6e\40\150\157\x75\162\x20\x77\x69\164\150\x20\x6c\x65\x61\x64\x69\156\x67\40\x7a\x65\162\x6f\x73\54\x20\x30\x31\x20\x74\157\x20\61\62\x20\x68" => array("\x68\150", "\x68"), "\x32\x34\x2d\150\x6f\165\x72\40\146\x6f\x72\155\141\164\40\157\146\40\x61\156\40\150\x6f\165\162\40\167\151\x74\150\x6f\x75\164\x20\154\x65\x61\144\x69\156\147\40\x7a\145\x72\x6f\x73\40\60\x20\164\157\40\x32\63\150" => array("\110", "\107"), "\x32\x34\55\150\x6f\x75\x72\x20\146\157\162\155\x61\164\40\x6f\x66\40\141\156\40\x68\157\165\x72\40\167\151\x74\150\40\x6c\x65\141\x64\x69\156\x67\x20\172\145\162\157\163\x2c\x20\x30\x30\40\164\x6f\x20\62\x33\40\x68" => array("\110\x48", "\x48"), "\x68\x6f\x75\162\40\x69\156\40\144\141\171\40\50\x31\176\62\x34\x29\40\x23\61" => array("\x6b", ''), "\150\x6f\x75\x72\x20\x69\x6e\40\144\x61\171\40\x28\x31\176\x32\x34\x29\40\x23\x32" => array("\153\153", ''), "\x68\157\x75\162\40\x69\156\x20\x61\155\x2f\x70\x6d\x20\50\x30\176\x31\x31\51\x20\43\x31" => array("\x4b", ''), "\x68\157\165\x72\x20\151\156\40\x61\x6d\57\x70\x6d\40\x28\x30\176\x31\61\51\40\43\x32" => array("\x4b\x4b", ''), "\x4d\x69\156\165\164\145\x73\40\x77\x69\x74\150\157\165\164\40\x6c\145\141\x64\151\156\x67\40\x7a\145\162\x6f\163\54\40\156\x6f\164\40\163\165\x70\x70\x6f\x72\164\x65\x64\x20\142\x79\40\x70\x68\160\x20\142\x75\164\x20\167\x65\x20\146\141\x6c\x6c\x62\x61\143\x6b" => array("\x6d", "\151"), "\115\151\156\x75\x74\x65\163\x20\x77\151\x74\150\x20\154\145\141\144\151\156\x67\x20\172\x65\x72\157\x73" => array("\155\x6d", "\x69"), "\x53\145\x63\x6f\156\x64\163\x2c\x20\167\x69\x74\150\x6f\165\x74\x20\x6c\x65\x61\x64\x69\156\147\x20\x7a\x65\x72\x6f\163\54\40\x6e\157\x74\x20\x73\x75\160\160\157\162\164\x65\144\x20\x62\x79\40\x70\150\160\40\142\165\164\x20\x77\x65\x20\x66\x61\154\x6c\x62\141\x63\153" => array("\163", "\163"), "\x53\x65\143\x6f\x6e\144\163\54\x20\167\x69\164\x68\40\x6c\x65\141\x64\151\156\x67\40\x7a\145\x72\157\x73" => array("\163\163", "\163"), "\x66\162\141\143\x74\x69\157\x6e\141\x6c\40\x73\x65\143\157\156\144\x20\x23\x31" => array("\123", ''), "\146\162\x61\143\x74\x69\157\156\x61\154\40\163\x65\143\x6f\156\144\40\x23\x32" => array("\x53\x53", ''), "\146\162\x61\143\x74\151\x6f\156\x61\x6c\x20\x73\145\143\157\156\144\40\43\63" => array("\123\123\x53", ''), "\x66\x72\x61\x63\x74\151\157\156\141\154\x20\x73\x65\143\157\x6e\144\40\x23\x34" => array("\123\x53\123\x53", ''), "\x6d\151\154\x6c\151\x73\145\x63\157\156\x64\163\x20\x69\156\40\x64\x61\x79" => array("\101", ''), "\x54\151\x6d\145\x7a\157\156\145\x20\x61\x62\142\162\145\x76\x69\141\x74\151\x6f\x6e\40\x23\61" => array("\172", "\124"), "\124\x69\155\145\172\157\x6e\145\x20\141\x62\x62\x72\145\x76\x69\x61\164\x69\x6f\156\x20\43\x32" => array("\x7a\x7a", "\124"), "\x54\151\x6d\145\172\x6f\x6e\145\x20\x61\x62\142\x72\x65\166\x69\141\164\x69\x6f\x6e\x20\x23\63" => array("\x7a\172\172", "\x54"), "\124\151\x6d\x65\172\157\x6e\145\40\146\x75\x6c\154\x20\156\x61\155\145\x2c\x20\x6e\157\164\x20\163\x75\x70\x70\157\162\164\x65\x64\40\142\171\x20\x70\150\160\x20\x62\165\164\40\167\145\40\146\141\154\x6c\142\x61\143\153" => array("\x7a\x7a\x7a\x7a", "\x54"), "\x44\151\146\146\145\x72\x65\x6e\x63\145\x20\x74\157\40\107\162\x65\x65\156\x77\x69\x63\x68\40\164\151\155\145\40\x28\107\115\x54\x29\40\x69\x6e\40\150\x6f\165\162\163\40\43\61" => array("\x5a", "\x4f"), "\x44\151\x66\x66\145\162\145\156\x63\x65\x20\x74\157\40\x47\162\145\x65\x6e\167\x69\143\x68\40\164\x69\155\x65\x20\x28\107\x4d\x54\x29\40\x69\x6e\40\150\x6f\165\162\163\40\43\x32" => array("\132\132", "\117"), "\x44\x69\x66\x66\x65\x72\x65\x6e\143\145\x20\164\157\x20\107\x72\x65\x65\156\x77\x69\143\150\x20\x74\x69\x6d\x65\x20\50\107\115\124\x29\40\151\x6e\x20\150\x6f\165\x72\163\40\43\63" => array("\x5a\132\132", "\x4f"), "\x54\151\155\145\x20\x5a\x6f\156\x65\x3a\x20\154\x6f\x6e\147\x20\x6c\x6f\143\x61\154\151\x7a\145\144\40\x47\x4d\x54\x20\x28\x3d\x4f\117\x4f\x4f\51\40\x65\x2e\x67\56\x20\107\115\x54\x2d\x30\70\x3a\60\60" => array("\132\132\x5a\x5a", "\134\107\134\x4d\134\x54\x50"), "\124\111\x6d\x65\x20\x5a\x6f\156\145\72\40\x49\x53\117\x38\66\60\61\x20\x65\x78\164\145\156\x64\145\144\40\x68\155\163\77\x20\50\75\130\130\130\130\x58\x29" => array("\132\x5a\132\132\x5a", ''), "\x54\x69\155\145\40\132\x6f\156\x65\x3a\40\163\x68\157\x72\x74\40\154\157\143\141\154\151\x7a\x65\144\40\x47\x4d\124\40\x65\56\147\x2e\x20\x47\115\124\x2d\x38" => array("\117", ''), "\x54\x69\155\145\x20\132\157\x6e\145\x3a\40\x6c\157\156\147\x20\154\x6f\x63\x61\x6c\x69\172\x65\144\x20\107\x4d\x54\x20\x28\x3d\x5a\x5a\132\132\51\x20\145\56\147\x2e\40\x47\x4d\x54\x2d\x30\x38\x3a\x30\x30" => array("\117\117\x4f\117", "\134\x47\134\x4d\x5c\124\x50"), "\x54\x69\x6d\x65\x20\132\157\x6e\145\x3a\40\x67\145\x6e\x65\x72\151\x63\40\x6e\x6f\156\55\154\x6f\x63\141\164\x69\x6f\x6e\x20\50\x66\141\x6c\x6c\163\40\x62\141\143\153\40\x66\x69\162\163\x74\40\x74\157\40\126\126\x56\126\x20\x61\x6e\x64\40\x74\150\x65\156\40\164\157\40\x4f\117\x4f\117\x29\x20\x75\163\x69\x6e\x67\40\164\x68\x65\40\x49\x43\x55\x20\x64\145\x66\x69\156\145\x64\x20\146\141\x6c\x6c\142\x61\x63\x6b\x20\x68\145\162\145\40\x23\61" => array("\x76", "\x5c\107\x5c\115\134\124\120"), "\x54\151\155\x65\40\x5a\157\x6e\145\x3a\x20\x67\145\156\145\162\151\x63\x20\x6e\157\156\x2d\x6c\157\x63\141\164\x69\157\x6e\x20\50\146\x61\x6c\x6c\163\x20\142\141\x63\153\40\146\151\x72\x73\164\x20\164\x6f\40\126\x56\126\x56\40\141\x6e\x64\40\x74\150\x65\x6e\40\164\157\x20\117\x4f\117\117\x29\x20\x75\x73\151\156\147\40\x74\150\x65\x20\111\x43\125\40\144\x65\x66\151\x6e\145\144\x20\x66\141\x6c\154\142\x61\x63\x6b\40\x68\x65\162\145\40\43\x32" => array("\166\x76\x76\x76", "\x5c\107\x5c\x4d\x5c\x54\120"), "\124\151\155\145\40\x5a\x6f\156\145\x3a\x20\163\150\157\162\164\40\164\x69\155\x65\40\x7a\157\x6e\x65\40\111\x44" => array("\x56", ''), "\x54\x69\155\x65\x20\132\x6f\x6e\x65\72\40\x6c\157\x6e\x67\x20\x74\151\155\x65\x20\x7a\x6f\x6e\145\40\x49\x44" => array("\126\126", "\x65"), "\x54\x69\155\145\x20\x5a\x6f\x6e\145\72\40\164\x69\x6d\x65\x20\172\157\156\145\40\145\170\145\155\160\154\x61\162\40\x63\151\164\x79" => array("\126\x56\126", ''), "\124\151\155\145\x20\x5a\157\156\145\x3a\x20\x67\x65\x6e\x65\x72\151\143\x20\x6c\157\143\141\x74\x69\x6f\x6e\x20\50\x66\141\x6c\154\x73\40\x62\x61\x63\x6b\40\x74\x6f\x20\x4f\117\x4f\x4f\x29\40\165\163\151\x6e\147\x20\x74\x68\145\x20\x49\103\125\x20\144\x65\x66\x69\x6e\x65\x64\x20\146\x61\154\x6c\142\x61\x63\153\x20\150\x65\x72\145" => array("\126\x56\126\x56", "\x5c\x47\x5c\x4d\x5c\x54\x50"), "\x54\x69\155\x65\x20\132\x6f\x6e\x65\72\x20\x49\123\117\70\66\x30\x31\x20\x62\141\163\x69\143\x20\x68\x6d\x3f\x2c\40\167\151\x74\x68\40\x5a\40\146\x6f\x72\x20\x30\54\40\x65\56\x67\56\x20\x2d\x30\70\54\40\x2b\x30\x35\63\60\54\40\132" => array("\130", ''), "\x54\x69\x6d\x65\x20\132\x6f\x6e\x65\72\40\111\123\x4f\x38\66\60\61\40\x62\141\x73\151\143\x20\150\x6d\x2c\40\x77\x69\x74\150\40\132\x2c\40\x65\56\x67\56\40\55\x30\70\60\x30\x2c\40\x5a" => array("\130\130", "\x4f\x2c\40\x5c\132"), "\x54\151\155\145\40\x5a\x6f\156\145\x3a\40\x49\x53\117\70\x36\60\61\40\145\x78\164\145\156\x64\x65\144\40\x68\x6d\x2c\40\167\x69\x74\x68\40\x5a\x2c\40\x65\x2e\x67\56\40\x2d\60\70\72\x30\x30\54\40\x5a" => array("\x58\130\x58", "\120\x2c\x20\134\132"), "\x54\151\155\x65\40\132\x6f\156\x65\72\x20\111\x53\117\70\66\x30\61\x20\x62\x61\x73\x69\x63\x20\150\x6d\x73\x3f\54\40\167\151\x74\x68\x20\x5a\54\40\x65\x2e\x67\x2e\40\55\x30\x38\x30\x30\x2c\x20\x2d\60\67\65\62\65\70\54\x20\132" => array("\130\130\x58\x58", ''), "\124\x69\x6d\145\40\132\x6f\156\x65\72\40\x49\123\x4f\x38\x36\x30\x31\x20\145\170\164\x65\156\x64\x65\x64\40\150\155\x73\77\x2c\40\x77\x69\164\150\x20\132\54\40\145\56\147\56\x20\x2d\x30\x38\x3a\x30\x30\54\x20\x2d\60\67\x3a\65\x32\72\x35\70\x2c\40\132" => array("\x58\x58\x58\x58\130", ''), "\124\x69\155\145\x20\x5a\157\156\x65\72\x20\111\123\117\x38\66\x30\61\40\142\x61\x73\151\x63\x20\150\155\77\54\40\x77\x69\164\150\x6f\165\164\x20\132\x20\146\x6f\162\x20\60\54\40\x65\56\x67\56\40\x2d\x30\x38\54\40\53\x30\65\63\x30" => array("\x78", ''), "\x54\151\155\145\x20\132\157\156\145\72\40\x49\x53\x4f\70\x36\60\61\x20\x62\141\163\x69\143\40\x68\155\x2c\40\167\x69\164\x68\x6f\165\164\40\132\x2c\x20\x65\x2e\x67\x2e\x20\x2d\x30\70\x30\60" => array("\x78\x78", "\x4f"), "\x54\x69\155\145\x20\x5a\157\156\x65\x3a\x20\111\123\117\70\x36\x30\61\40\x65\x78\x74\145\156\x64\x65\144\x20\x68\155\x2c\x20\x77\x69\x74\150\x6f\x75\x74\40\132\54\x20\x65\56\x67\56\40\x2d\60\70\72\x30\60" => array("\x78\170\170", "\x50"), "\124\151\155\145\x20\132\157\x6e\145\x3a\40\111\123\117\x38\66\60\x31\40\142\141\163\151\x63\x20\x68\155\163\77\x2c\40\x77\x69\x74\150\157\x75\x74\x20\x5a\x2c\x20\145\56\x67\x2e\x20\55\60\x38\x30\x30\x2c\40\55\60\x37\65\62\65\x38" => array("\x78\x78\170\x78", ''), "\x54\151\x6d\145\40\132\157\156\145\72\x20\x49\123\x4f\70\x36\x30\x31\40\x65\x78\164\145\x6e\x64\145\x64\x20\150\155\x73\77\54\x20\167\151\164\x68\157\x75\x74\40\x5a\54\x20\x65\x2e\147\x2e\40\x2d\x30\x38\x3a\x30\x30\54\40\x2d\x30\x37\x3a\65\x32\72\x35\70" => array("\170\x78\x78\x78\170", '')); } public function testEscapedIcuToPhpSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDateIcuToPhp($pattern)); } public function testEscapedIcuToJui() { $this->assertEquals("\x44\104\54\x20\115\115\40\144\54\x20\x79\171\x20\47\x61\164\x27\x20", FormatConverter::convertDateIcuToJui("\105\x45\x45\105\54\40\x4d\x4d\x4d\115\x20\x64\x2c\x20\x79\x20\47\x61\x74\47\40\x7a\x7a\172\x7a")); $this->assertEquals("\47\157\47\47\143\x6c\x6f\143\x6b\47", FormatConverter::convertDateIcuToJui("\47\x6f\47\x27\143\x6c\157\143\x6b\x27")); } public function testIntlIcuToJuiShortForm() { $this->assertEquals("\x6d\x2f\144\x2f\x79", FormatConverter::convertDateIcuToJui("\163\150\x6f\162\x74", "\144\x61\x74\x65", "\145\x6e\55\125\x53")); $this->assertEquals("\x64\144\56\155\155\56\171", FormatConverter::convertDateIcuToJui("\163\x68\157\162\x74", "\144\x61\164\x65", "\x64\x65\x2d\x44\x45")); } public function testIntlIcuToJuiShortFormDefaultLang() { Yii::$app->language = "\x65\156"; $this->assertEquals("\155\x2f\144\57\x79", FormatConverter::convertDateIcuToJui("\163\150\157\162\164", "\x64\x61\x74\145")); Yii::$app->language = "\144\x65"; $this->assertEquals("\x64\144\x2e\155\x6d\56\171", FormatConverter::convertDateIcuToJui("\x73\x68\157\x72\164", "\144\141\x74\x65")); } public function testIntlIcuToJuiShortFormTime() { $this->assertEqualsAnyWhitespace("\x3a\40", FormatConverter::convertDateIcuToJui("\163\150\157\162\x74", "\164\151\155\x65", "\x65\x6e\x2d\125\x53")); $this->assertEqualsAnyWhitespace("\72", FormatConverter::convertDateIcuToJui("\163\150\157\x72\x74", "\x74\x69\155\145", "\x64\145\x2d\x44\x45")); } public function testIntlIcuToJuiShortFormDateTime() { $this->assertEqualsAnyWhitespace("\x6d\x2f\x64\57\x79\54\40\72\x20", FormatConverter::convertDateIcuToJui("\163\x68\x6f\162\x74", "\x64\x61\x74\x65\164\151\155\x65", "\145\156\x2d\125\123")); $this->assertEquals(PHP_VERSION_ID < 50600 ? "\x64\x64\x2e\x6d\x6d\x2e\171\x20\x3a" : "\x64\144\56\155\155\x2e\x79\x2c\x20\72", FormatConverter::convertDateIcuToJui("\163\x68\x6f\162\x74", "\x64\x61\164\145\x74\x69\x6d\145", "\x64\145\x2d\104\105")); } public function providerForICU2JUIPatterns() { return array("\145\x72\x61\x20\144\145\x73\151\x67\x6e\x61\x74\x6f\162\40\154\151\153\x65\40\x28\101\156\x6e\x6f\x20\104\157\155\151\x6e\151\51" => array("\107", ''), "\64\144\x69\x67\151\164\40\x79\x65\141\162\40\157\x66\x20\x22\127\x65\x65\153\x20\x6f\x66\x20\x59\145\x61\162\42" => array("\x59", ''), "\x34\144\x69\x67\151\164\40\x79\x65\x61\x72\40\x65\56\x67\x2e\x20\62\x30\x31\x34\40\x23\61" => array("\x79", "\171\171"), "\x34\x64\x69\x67\x69\x74\x20\x79\x65\141\x72\40\x65\56\x67\x2e\x20\62\x30\61\64\40\x23\x32" => array("\171\x79\x79\171", "\171\x79"), "\62\x64\151\147\151\x74\40\171\x65\x61\162\x20\x6e\165\155\142\x65\162\40\x65\147\x2e\40\61\64" => array("\171\171", "\171"), "\145\170\164\x65\156\x64\x65\x64\x20\x79\x65\x61\162\x20\x65\x2e\x67\56\x20\64\x36\60\x31" => array("\165", ''), "\x63\x79\x63\154\x69\x63\40\x79\145\x61\x72\40\x6e\x61\x6d\145\54\x20\141\163\40\x69\156\x20\103\x68\x69\x6e\x65\163\145\40\x6c\165\x6e\x61\162\40\x63\141\x6c\145\156\x64\141\x72" => array("\x55", ''), "\162\x65\x6c\x61\x74\145\x64\40\x47\x72\145\147\157\x72\151\141\x6e\40\171\x65\x61\x72\x20\145\56\x67\x2e\40\61\71\71\x36" => array("\x72", ''), "\156\x75\155\142\145\162\40\157\x66\40\161\x75\x61\x72\x74\145\x72" => array("\x51", ''), "\156\x75\x6d\142\x65\x72\40\157\146\40\x71\165\x61\x72\x74\145\x72\40\x22\60\x32\42" => array("\121\121", ''), "\161\165\141\x72\164\145\x72\40\x22\121\x32\x22" => array("\121\x51\x51", ''), "\x71\x75\141\162\x74\x65\162\40\x22\x32\x6e\144\x20\161\165\141\x72\x74\x65\x72\x22" => array("\121\121\x51\x51", ''), "\156\x75\155\x62\x65\162\x20\157\x66\40\x71\165\x61\x72\164\x65\162\x20\x22\x32\42" => array("\121\x51\121\x51\x51", ''), "\156\x75\x6d\x62\145\162\x20\x6f\146\x20\123\x74\141\156\x64\40\x41\x6c\157\156\x65\x20\x71\x75\x61\162\164\145\162" => array("\161", ''), "\x6e\165\155\x62\x65\x72\40\157\146\40\123\x74\141\156\144\x20\x41\154\157\x6e\x65\x20\161\x75\141\162\x74\x65\x72\x20\x22\60\62\x22" => array("\161\161", ''), "\x53\x74\x61\156\x64\40\101\154\157\156\x65\x20\161\x75\141\162\x74\x65\x72\x20\42\x51\x32\x22" => array("\x71\161\x71", ''), "\123\x74\x61\156\x64\40\x41\x6c\157\x6e\145\40\161\165\x61\x72\x74\x65\x72\40\x22\x32\x6e\144\40\x71\165\141\x72\164\x65\162\x22" => array("\x71\161\161\161", ''), "\156\x75\x6d\x62\x65\162\x20\x6f\x66\x20\123\x74\x61\x6e\x64\40\101\x6c\x6f\156\x65\x20\x71\165\x61\x72\164\x65\x72\x20\42\x32\42" => array("\161\161\161\161\161", ''), "\116\x75\x6d\x65\162\x69\143\x20\162\145\160\162\x65\163\x65\x6e\x74\141\164\x69\x6f\156\x20\157\146\40\141\40\155\157\156\x74\x68\x2c\40\x77\151\164\150\157\x75\x74\x20\x6c\x65\x61\144\151\156\x67\40\172\145\162\157\x73" => array("\x4d", "\x6d"), "\x4e\x75\x6d\x65\162\x69\143\40\162\145\160\162\x65\x73\x65\156\164\x61\x74\x69\157\x6e\40\157\146\x20\x61\x20\155\157\x6e\164\x68\54\40\167\151\x74\150\40\154\x65\x61\144\151\156\147\40\172\x65\x72\157\x73" => array("\x4d\x4d", "\155\155"), "\101\x20\163\150\157\162\164\x20\x74\145\170\x74\x75\141\x6c\40\x72\x65\160\162\145\163\x65\156\164\141\164\151\157\156\40\x6f\146\40\x61\40\155\x6f\x6e\164\150\x2c\x20\x74\150\162\x65\x65\40\x6c\145\164\x74\x65\x72\163" => array("\115\115\x4d", "\x4d"), "\x41\40\x66\x75\154\x6c\40\164\x65\x78\x74\x75\141\x6c\40\x72\145\x70\162\145\x73\x65\156\x74\x61\x74\x69\157\x6e\x20\x6f\146\40\141\40\155\157\x6e\x74\150\54\x20\x73\x75\x63\x68\40\x61\x73\40\x4a\x61\156\165\x61\x72\x79\x20\157\162\x20\x4d\141\x72\143\x68" => array("\x4d\x4d\x4d\115", "\x4d\x4d"), "\115\115\115\115\115" => array("\115\x4d\115\x4d\x4d", ''), "\123\164\x61\x6e\x64\40\141\154\x6f\156\x65\x20\x6d\x6f\x6e\164\150\40\151\x6e\x20\x79\145\141\162\40\43\x31" => array("\x4c", "\155"), "\x53\x74\x61\156\x64\40\x61\154\x6f\x6e\x65\x20\155\x6f\156\164\x68\x20\151\x6e\40\171\145\x61\162\40\x23\x32" => array("\114\x4c", "\x6d\155"), "\x53\164\x61\x6e\x64\x20\141\154\x6f\156\145\x20\x6d\157\156\164\150\x20\x69\156\x20\x79\145\141\162\x20\43\x33" => array("\x4c\114\x4c", "\x4d"), "\123\x74\x61\156\144\x20\x61\x6c\x6f\156\145\40\155\157\x6e\x74\150\40\x69\x6e\40\x79\145\141\162\40\43\x34" => array("\114\114\x4c\114", "\115\115"), "\x53\164\x61\x6e\144\x20\141\x6c\x6f\156\x65\40\155\x6f\156\x74\x68\40\151\x6e\40\x79\x65\x61\162\40\x23\x35" => array("\114\x4c\x4c\114\x4c", ''), "\111\123\x4f\x2d\70\x36\x30\x31\x20\167\145\145\153\40\x6e\165\x6d\142\x65\x72\x20\157\146\40\x79\x65\141\162\x20\43\61" => array("\x77", ''), "\111\x53\117\x2d\x38\66\60\x31\40\x77\x65\145\x6b\40\156\x75\x6d\142\x65\x72\40\157\x66\40\171\x65\141\x72\40\43\62" => array("\x77\167", ''), "\167\x65\x65\153\x20\157\x66\40\164\x68\x65\x20\x63\x75\162\162\145\156\x74\x20\x6d\157\156\x74\150" => array("\127", ''), "\144\x61\171\40\167\151\164\x68\157\x75\164\40\154\145\141\x64\151\x6e\147\40\172\x65\x72\x6f\x73" => array("\x64", "\x64"), "\x64\x61\171\x20\x77\151\x74\150\x20\x6c\x65\x61\x64\x69\156\x67\x20\x7a\145\x72\157\x73" => array("\144\x64", "\144\x64"), "\x64\141\x79\40\x6f\x66\x20\x74\150\x65\x20\x79\x65\141\x72\40\60\40\164\157\40\x33\66\65" => array("\104", "\157"), "\104\x61\x79\x20\157\x66\x20\x57\145\x65\153\x20\151\156\x20\115\157\x6e\x74\150\x2e\x20\145\147\56\40\62\156\x64\40\127\145\x64\156\x65\x73\144\141\x79\x20\151\156\x20\112\165\x6c\x79" => array("\x46", ''), "\x4d\x6f\144\x69\x66\151\145\144\40\x4a\x75\154\151\x61\156\40\x64\141\x79\56\40\x54\150\x69\x73\x20\151\x73\40\x64\x69\x66\146\x65\x72\x65\156\x74\40\x66\162\157\x6d\40\x74\150\x65\40\x63\x6f\156\166\145\x6e\x74\151\x6f\156\x61\x6c\x20\112\165\x6c\151\141\156\x20\144\141\x79\x20\156\x75\155\x62\x65\x72\40\x69\x6e\x20\x74\167\157\x20\162\x65\147\141\x72\x64\163\x2e" => array("\147", ''), "\144\x61\171\x20\157\146\40\167\145\145\x6b\40\x77\x72\151\164\164\x65\x6e\40\151\156\40\163\x68\157\162\164\40\146\x6f\x72\155\x20\x65\x67\x2e\x20\x53\x75\156" => array("\105", "\104"), "\x45\x45" => array("\105\x45", "\104"), "\105\x45\105" => array("\x45\x45\105", "\104"), "\x64\x61\x79\40\x6f\x66\x20\167\x65\145\153\x20\x66\x75\x6c\154\x79\x20\167\x72\x69\x74\164\145\x6e\40\x65\x67\56\40\x53\x75\x6e\x64\141\x79" => array("\x45\x45\x45\105", "\104\x44"), "\x45\105\105\105\105" => array("\x45\x45\x45\x45\x45", ''), "\105\105\105\105\105\x45" => array("\105\105\x45\105\105\x45", ''), "\111\x53\x4f\x2d\x38\66\x30\x31\x20\156\x75\x6d\145\162\151\143\x20\x72\x65\160\162\145\x73\145\x6e\x74\141\164\x69\x6f\156\40\x6f\x66\40\x74\x68\x65\40\x64\141\x79\x20\x6f\146\x20\164\x68\x65\40\x77\145\x65\x6b\x20\61\x3d\x4d\x6f\156\x20\x74\157\40\x37\75\x53\165\156\40\43\x31" => array("\x65", ''), "\160\x68\160\x20\42\x77\42\x20\60\75\123\x75\x6e\40\x74\x6f\x20\66\75\x53\x61\164\40\x69\x73\156\140\164\x20\x73\165\160\160\157\162\x74\x65\x64\40\x62\x79\40\111\x43\125\x20\x2d\x3e\x20\42\167\42\40\155\145\x61\156\163\x20\167\145\145\x6b\40\x6e\x75\x6d\142\x65\x72\x20\157\146\x20\171\145\x61\x72\40\43\61" => array("\145\145", ''), "\x65\145\x65" => array("\145\145\x65", "\104"), "\x65\x65\x65\145" => array("\x65\145\145\x65", ''), "\x65\x65\145\145\145" => array("\x65\145\x65\x65\x65", ''), "\x65\145\x65\x65\x65\145" => array("\145\x65\145\x65\x65\x65", ''), "\111\123\x4f\55\x38\x36\60\x31\x20\x6e\x75\155\145\x72\151\143\x20\162\x65\160\x72\x65\163\x65\x6e\164\x61\164\x69\x6f\x6e\x20\157\146\40\x74\x68\145\40\144\x61\x79\40\157\x66\40\164\150\x65\40\167\x65\x65\x6b\40\x31\x3d\115\157\x6e\40\164\x6f\x20\67\x3d\123\165\x6e\40\43\x32" => array("\x63", ''), "\160\x68\160\x20\x22\167\42\40\x30\x3d\x53\165\156\x20\164\157\40\66\x3d\123\141\164\x20\x69\x73\x6e\140\164\40\163\165\160\160\157\x72\x74\145\144\x20\x62\171\x20\111\103\125\40\x2d\76\x20\x22\x77\42\x20\155\x65\x61\x6e\x73\x20\167\145\x65\x6b\40\x6e\x75\x6d\142\145\x72\40\x6f\x66\x20\x79\145\141\162\x20\43\x32" => array("\143\x63", ''), "\143\x63\143" => array("\x63\x63\143", "\104"), "\x63\143\143\143" => array("\143\143\x63\143", "\x44\104"), "\143\143\143\143\x63" => array("\143\x63\x63\143\143", ''), "\x63\143\x63\143\x63\143" => array("\143\x63\x63\143\x63\143", ''), "\141\155\57\160\155\40\x6d\141\x72\x6b\145\162" => array("\141", ''), "\x31\62\55\150\157\x75\162\x20\146\157\162\155\141\164\40\x6f\x66\40\x61\156\x20\150\x6f\165\162\40\x77\151\164\x68\x6f\165\164\40\154\145\141\144\x69\x6e\147\40\x7a\x65\x72\x6f\x73\x20\61\40\164\x6f\x20\61\x32\150" => array("\150", ''), "\61\62\55\150\157\165\162\40\146\157\x72\x6d\141\x74\x20\x6f\x66\40\x61\x6e\40\x68\x6f\x75\x72\x20\x77\x69\x74\150\40\154\x65\141\144\x69\156\x67\40\x7a\x65\162\x6f\163\54\40\x30\x31\40\x74\157\40\x31\62\x20\x68" => array("\x68\x68", ''), "\x32\x34\x2d\x68\x6f\165\162\40\x66\157\x72\x6d\141\164\x20\157\x66\40\x61\x6e\x20\x68\x6f\165\x72\40\x77\x69\x74\150\x6f\165\164\x20\154\145\141\144\x69\156\x67\40\172\145\x72\157\x73\x20\60\x20\164\157\x20\x32\x33\150" => array("\110", ''), "\x32\64\x2d\150\x6f\165\162\40\146\157\162\155\141\x74\40\157\146\40\141\156\40\150\157\x75\162\40\x77\x69\164\x68\40\x6c\x65\x61\144\x69\x6e\147\40\x7a\145\x72\x6f\x73\54\x20\60\x30\40\164\157\x20\62\x33\x20\150" => array("\110\x48", ''), "\x68\x6f\165\162\x20\151\156\40\x64\141\171\40\x28\x31\176\x32\x34\x29\x20\43\x31" => array("\x6b", ''), "\x68\x6f\x75\x72\40\151\156\x20\144\x61\x79\40\x28\61\176\x32\64\x29\x20\x23\62" => array("\153\x6b", ''), "\150\x6f\x75\x72\40\x69\x6e\x20\141\x6d\x2f\x70\x6d\x20\x28\x30\176\61\61\51\x20\43\x31" => array("\113", ''), "\x68\157\165\162\40\151\156\40\x61\x6d\57\x70\x6d\40\50\x30\x7e\61\61\x29\40\x23\62" => array("\113\x4b", ''), "\x4d\151\156\165\164\145\x73\x20\x77\151\164\x68\x6f\165\x74\x20\x6c\x65\141\x64\x69\x6e\x67\x20\x7a\x65\x72\x6f\163\x2c\x20\x6e\x6f\x74\40\163\x75\x70\160\157\x72\164\145\144\40\142\x79\x20\160\150\x70\40\x62\165\x74\40\x77\145\40\x66\141\x6c\x6c\x62\141\143\x6b" => array("\x6d", ''), "\x4d\x69\156\165\164\145\163\x20\167\x69\164\150\40\x6c\x65\x61\x64\x69\x6e\147\40\172\145\x72\157\x73" => array("\155\155", ''), "\x53\x65\143\x6f\156\x64\x73\x2c\40\x77\x69\164\150\157\165\x74\x20\x6c\x65\x61\x64\151\156\147\40\172\x65\162\x6f\x73\x2c\40\x6e\x6f\x74\x20\x73\165\160\x70\x6f\162\x74\145\144\x20\142\171\40\160\150\160\x20\142\x75\164\x20\167\x65\x20\x66\x61\x6c\x6c\x62\x61\x63\x6b" => array("\x73", ''), "\123\x65\x63\x6f\156\144\163\54\40\167\151\164\x68\40\154\x65\141\144\151\x6e\147\x20\x7a\x65\162\157\x73" => array("\163\163", ''), "\x66\162\x61\143\x74\151\157\x6e\141\x6c\x20\x73\145\x63\157\x6e\144\40\x23\x31" => array("\123", ''), "\x66\x72\x61\x63\164\151\157\156\141\x6c\x20\163\145\143\157\x6e\144\x20\43\62" => array("\x53\x53", ''), "\146\x72\x61\143\164\x69\x6f\156\141\154\40\x73\x65\x63\157\x6e\x64\40\x23\63" => array("\x53\x53\x53", ''), "\146\162\141\x63\164\x69\x6f\156\141\154\40\163\145\143\157\156\144\x20\x23\64" => array("\123\x53\x53\x53", ''), "\155\151\154\x6c\151\x73\145\143\157\156\144\x73\x20\x69\x6e\40\x64\141\x79" => array("\101", ''), "\x54\151\x6d\x65\172\157\x6e\x65\40\x61\142\x62\x72\x65\x76\x69\141\x74\151\x6f\x6e\x20\x23\61" => array("\x7a", ''), "\x54\x69\155\x65\172\157\156\x65\x20\141\x62\142\x72\145\x76\151\x61\164\151\x6f\x6e\40\43\62" => array("\172\172", ''), "\124\x69\155\x65\x7a\x6f\x6e\145\x20\141\142\x62\x72\x65\166\151\141\164\x69\x6f\x6e\x20\43\x33" => array("\x7a\172\x7a", ''), "\124\x69\155\145\x7a\x6f\x6e\145\40\x66\x75\x6c\154\40\156\141\155\145\54\x20\x6e\x6f\164\40\x73\165\160\160\157\162\x74\145\144\x20\x62\x79\40\x70\150\x70\40\142\x75\x74\40\167\145\40\x66\141\x6c\x6c\x62\x61\x63\153" => array("\x7a\172\172\x7a", ''), "\x44\151\x66\x66\x65\x72\145\x6e\x63\145\40\164\x6f\x20\x47\x72\x65\x65\x6e\167\151\x63\x68\40\164\151\x6d\145\40\50\x47\115\x54\x29\40\151\156\40\150\157\165\x72\163\40\43\x31" => array("\132", ''), "\x44\151\146\x66\145\x72\x65\x6e\x63\x65\40\164\x6f\x20\x47\x72\x65\x65\156\167\x69\x63\150\x20\164\151\x6d\145\40\x28\x47\115\124\51\40\x69\156\40\x68\x6f\x75\162\x73\40\43\62" => array("\x5a\x5a", ''), "\104\x69\x66\146\x65\x72\x65\x6e\143\x65\40\164\157\40\107\x72\x65\x65\156\167\x69\143\x68\x20\164\x69\155\x65\40\x28\x47\x4d\x54\51\40\151\x6e\40\150\157\x75\x72\163\40\x23\x33" => array("\132\132\x5a", ''), "\x54\x69\x6d\145\40\132\157\156\145\x3a\x20\x6c\157\156\147\x20\x6c\157\143\141\154\151\172\145\x64\x20\107\115\124\40\x28\x3d\117\x4f\117\117\x29\x20\145\56\x67\x2e\40\x47\115\124\55\60\x38\x3a\x30\x30" => array("\132\x5a\x5a\x5a", ''), "\124\x69\155\145\x20\x5a\x6f\156\145\72\x20\x49\123\117\70\66\60\x31\x20\145\170\x74\x65\156\x64\x65\144\x20\150\155\163\x3f\40\50\75\x58\130\130\130\130\x29" => array("\132\132\x5a\x5a\x5a", ''), "\124\151\155\x65\x20\x5a\x6f\156\145\72\40\163\x68\157\x72\164\40\x6c\157\143\x61\x6c\151\172\x65\144\40\x47\x4d\x54\40\145\x2e\147\x2e\x20\x47\115\124\x2d\x38" => array("\x4f", ''), "\124\x69\x6d\145\40\x5a\157\156\145\x3a\x20\154\x6f\156\x67\40\x6c\157\143\141\x6c\151\172\x65\x64\40\107\115\124\40\50\x3d\132\x5a\x5a\x5a\x29\x20\145\x2e\147\x2e\x20\107\115\124\55\60\70\72\60\x30" => array("\x4f\x4f\117\x4f", ''), "\x54\151\155\x65\x20\x5a\x6f\156\145\x3a\x20\x67\x65\156\x65\x72\151\143\x20\x6e\157\156\x2d\154\157\x63\141\x74\x69\157\x6e\x20\x28\146\141\154\154\163\x20\142\141\143\x6b\40\146\x69\x72\x73\164\40\164\157\x20\126\126\x56\x56\x20\x61\156\144\40\x74\150\145\156\40\x74\157\x20\117\x4f\x4f\x4f\x29\40\x75\x73\151\156\x67\x20\164\150\x65\x20\x49\103\125\40\144\145\x66\151\x6e\145\144\40\146\141\x6c\154\x62\x61\x63\x6b\40\x68\145\162\145\40\43\61" => array("\x76", ''), "\124\x69\155\145\x20\132\157\156\145\x3a\40\x67\x65\156\x65\162\151\143\40\156\157\156\x2d\x6c\x6f\143\141\164\151\x6f\x6e\x20\50\146\141\x6c\x6c\163\40\142\x61\143\153\x20\x66\151\x72\x73\164\x20\x74\x6f\x20\126\x56\x56\x56\x20\141\156\144\x20\x74\150\x65\x6e\x20\x74\x6f\x20\x4f\117\x4f\117\x29\40\x75\x73\151\156\x67\40\164\x68\x65\40\x49\x43\125\40\x64\145\x66\x69\x6e\x65\x64\x20\x66\x61\154\x6c\x62\141\143\x6b\x20\x68\145\162\145\40\x23\62" => array("\166\166\166\x76", ''), "\x54\151\x6d\x65\40\132\157\x6e\x65\72\x20\x73\x68\x6f\x72\164\40\164\x69\155\x65\x20\x7a\157\x6e\145\40\x49\104" => array("\x56", ''), "\124\x69\x6d\145\40\x5a\157\156\x65\72\x20\x6c\x6f\x6e\147\40\x74\x69\x6d\x65\x20\x7a\x6f\156\x65\40\x49\104" => array("\126\126", ''), "\124\x69\155\145\40\x5a\x6f\156\145\72\x20\164\x69\155\x65\40\x7a\x6f\156\145\40\145\170\x65\x6d\x70\x6c\x61\x72\x20\143\x69\x74\171" => array("\x56\x56\126", ''), "\124\x69\x6d\x65\40\x5a\x6f\156\145\72\x20\147\145\156\x65\x72\x69\x63\40\x6c\x6f\143\x61\164\151\157\x6e\40\50\146\141\154\x6c\x73\40\142\x61\143\153\40\164\x6f\x20\117\x4f\x4f\x4f\x29\x20\x75\163\151\x6e\147\40\164\x68\x65\40\111\103\125\x20\144\145\x66\151\x6e\145\x64\40\146\141\154\154\x62\x61\x63\x6b\x20\x68\x65\x72\145" => array("\126\126\126\126", ''), "\124\151\155\145\40\x5a\157\x6e\145\x3a\x20\x49\123\x4f\x38\x36\60\61\40\x62\141\x73\x69\143\40\150\155\x3f\54\x20\167\151\164\150\x20\132\40\x66\x6f\x72\40\x30\x2c\40\145\56\147\56\x20\x2d\60\x38\x2c\x20\x2b\x30\65\63\x30\x2c\40\x5a" => array("\130", ''), "\x54\x69\x6d\x65\40\132\157\156\x65\72\40\x49\x53\x4f\70\66\60\61\x20\142\x61\x73\151\143\40\x68\155\54\40\x77\151\x74\150\40\132\54\40\x65\56\x67\56\40\55\x30\70\60\x30\x2c\x20\x5a" => array("\x58\130", ''), "\124\x69\x6d\x65\40\132\157\x6e\x65\x3a\40\111\123\x4f\70\66\x30\61\40\x65\170\x74\x65\156\x64\145\144\x20\x68\155\54\40\x77\x69\x74\x68\x20\x5a\x2c\40\145\x2e\x67\x2e\x20\55\60\x38\72\60\60\x2c\x20\x5a" => array("\x58\x58\x58", ''), "\124\151\155\x65\40\132\x6f\x6e\x65\72\40\x49\x53\117\70\x36\x30\x31\x20\x62\x61\x73\x69\143\40\150\155\163\77\x2c\40\167\151\164\150\x20\132\x2c\x20\145\56\x67\x2e\40\x2d\x30\70\x30\x30\x2c\x20\x2d\x30\x37\65\62\65\x38\x2c\x20\132" => array("\130\130\130\130", ''), "\x54\x69\x6d\145\40\132\x6f\156\x65\x3a\40\x49\x53\x4f\x38\66\x30\x31\x20\x65\170\164\145\156\144\145\x64\x20\150\155\163\x3f\54\x20\x77\151\164\150\40\132\x2c\40\145\56\x67\56\40\55\x30\70\72\x30\x30\x2c\40\x2d\60\x37\x3a\x35\x32\x3a\x35\70\54\40\x5a" => array("\x58\130\130\130\130", ''), "\x54\151\x6d\145\x20\x5a\x6f\x6e\x65\x3a\x20\x49\123\x4f\70\66\60\61\x20\142\x61\x73\x69\143\40\x68\155\x3f\54\x20\167\x69\164\x68\x6f\x75\x74\40\x5a\40\146\157\x72\x20\60\x2c\40\x65\x2e\x67\x2e\40\x2d\x30\70\54\40\53\x30\x35\x33\x30" => array("\x78", ''), "\124\151\x6d\x65\40\132\x6f\x6e\x65\72\x20\x49\123\x4f\x38\x36\60\61\x20\x62\141\163\x69\x63\40\150\x6d\x2c\x20\167\151\x74\x68\157\165\x74\x20\132\x2c\40\145\56\147\x2e\x20\x2d\x30\x38\60\x30" => array("\170\170", ''), "\x54\151\x6d\145\40\132\x6f\x6e\x65\x3a\x20\x49\x53\117\70\x36\x30\61\x20\145\x78\x74\x65\x6e\144\145\144\x20\x68\x6d\54\40\x77\151\164\150\157\165\x74\x20\132\x2c\x20\x65\x2e\147\x2e\x20\x2d\60\70\x3a\x30\x30" => array("\x78\x78\x78", ''), "\x54\151\155\x65\x20\x5a\157\x6e\x65\72\x20\x49\123\x4f\x38\66\x30\61\40\142\141\163\151\143\x20\150\155\x73\x3f\x2c\x20\x77\x69\164\150\x6f\165\x74\x20\x5a\54\x20\x65\x2e\x67\56\x20\x2d\60\70\x30\60\54\40\x2d\x30\x37\65\62\x35\x38" => array("\x78\170\x78\x78", ''), "\124\x69\x6d\145\x20\132\157\x6e\x65\x3a\x20\111\x53\x4f\x38\66\60\61\40\x65\x78\x74\x65\x6e\144\145\144\x20\150\x6d\163\x3f\54\x20\x77\x69\x74\150\157\165\164\40\x5a\54\x20\x65\x2e\x67\x2e\40\55\60\x38\72\x30\x30\x2c\x20\55\x30\67\72\65\62\x3a\x35\x38" => array("\x78\170\x78\x78\x78", '')); } public function testEscapedIcuToJuiSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDateIcuToJui($pattern)); } public function testIntlOneDigitIcu() { $formatter = new Formatter(array("\154\157\x63\x61\154\x65" => "\x65\156\x2d\125\123")); $this->assertEquals("\x32\x34\56\x38\x2e\x32\x30\61\64", $formatter->asDate("\x32\60\x31\x34\x2d\x38\55\62\64", "\160\150\160\72\x64\56\x6e\56\x59")); $this->assertEquals("\x32\x34\x2e\x38\56\x32\x30\61\x34", $formatter->asDate("\62\60\x31\x34\x2d\x38\x2d\62\x34", "\144\x2e\115\56\x79\171\171\171")); $this->assertEquals("\x32\64\x2e\70\x2e\62\60\61\64", $formatter->asDate("\62\x30\61\x34\55\x38\55\x32\64", "\x64\56\114\x2e\x79\x79\x79\x79")); } public function testOneDigitIcu() { $formatter = new Formatter(array("\154\157\143\141\x6c\x65" => "\145\x6e\x2d\x55\123")); $this->assertEquals("\62\64\x2e\x38\56\62\60\x31\x34", $formatter->asDate("\62\x30\x31\x34\55\x38\x2d\x32\x34", "\160\150\x70\72\x64\56\156\56\x59")); $this->assertEquals("\62\x34\x2e\x38\x2e\x32\x30\x31\64", $formatter->asDate("\62\x30\x31\x34\x2d\70\55\x32\x34", "\x64\x2e\115\x2e\x79\x79\171\171")); $this->assertEquals("\62\64\56\70\56\62\60\61\64", $formatter->asDate("\62\x30\61\x34\55\x38\x2d\62\x34", "\x64\x2e\114\x2e\x79\171\171\x79")); } public function testIntlUtf8Ru() { $this->assertEquals("\x64\x20\115\x20\x59\x20\x5c\xd0\263\x2e", FormatConverter::convertDateIcuToPhp("\144\144\40\x4d\115\x4d\x20\x79\40\47\xd0\263\47\x2e", "\x64\x61\164\x65", "\x72\x75\55\122\x55")); $this->assertEquals("\144\144\40\115\x20\171\171\x20\47\320\xb3\x27\x2e", FormatConverter::convertDateIcuToJui("\144\144\x20\x4d\x4d\115\x20\171\40\x27\320\xb3\x27\x2e", "\x64\x61\x74\x65", "\162\165\55\122\x55")); $formatter = new Formatter(array("\154\x6f\143\x61\154\145" => "\x72\165\x2d\x52\125")); $this->assertMatchesRegularExpression("\x2f\x32\x34\x20\xd0\xb0\xd0\xb2\xd0\xb3\x5c\x2e\x3f\x20\62\x30\61\64\x20\320\263\x5c\x2e\x2f", $formatter->asDate("\x32\x30\61\x34\55\70\55\62\x34", "\x64\x64\40\115\x4d\115\x20\171\40\x27\320\xb3\47\x2e")); } public function testPhpToICUMixedPatterns() { $expected = "\x79\171\x79\171\x2d\115\x4d\55\x64\x64\x27\x54\x27\110\x48\x3a\155\x6d\72\x73\x73\170\x78\170"; $actual = FormatConverter::convertDatePhpToIcu("\131\55\155\x2d\144\x5c\x54\x48\72\151\72\x73\x50"); $this->assertEquals($expected, $actual); $expected = "\171\171\171\x79\x2d\115\x4d\x2d\x64\144\x27\x59\x69\x69\x27\110\110\72\x6d\155\72\163\163\170\170\x78"; $actual = FormatConverter::convertDatePhpToIcu("\131\x2d\155\55\144\134\131\134\151\x5c\151\x48\x3a\151\x3a\163\x50"); $this->assertEquals($expected, $actual); $expected = "\171\171\171\171\55\x4d\115\x2d\x64\x64\47\x59\x69\151\47\x48\110\x3a\155\155\72\163\163\170\x78\170\x27\47\47\47"; $actual = FormatConverter::convertDatePhpToIcu("\131\55\x6d\x2d\x64\x5c\x59\134\x69\134\151\110\72\x69\x3a\163\x50\x27\47"); $this->assertEquals($expected, $actual); $expected = "\171\x79\x79\171\x2d\115\x4d\55\144\x64\x27\x59\151\151\47\x5c\x48\x48\72\x6d\155\72\x73\x73\170\170\170\47\47\x27\x27"; $actual = FormatConverter::convertDatePhpToIcu("\x59\55\x6d\x2d\144\134\x59\x5c\x69\134\151\x5c\134\x48\x3a\151\x3a\163\120\47\47"); $this->assertEquals($expected, $actual); $expected = "\47\144\104\152\154\x4e\x53\167\x5a\127\106\155\x4d\156\164\114\157\131\171\x61\x42\x67\150\x48\x69\x73\165\x65\111\117\x50\x54\x5a\143\x72\165\47"; $actual = FormatConverter::convertDatePhpToIcu("\134\x64\x5c\x44\x5c\152\134\154\134\x4e\x5c\123\x5c\167\134\x5a\x5c\x57\x5c\x46\134\155\134\115\134\x6e\134\164\134\x4c\134\157\x5c\x59\134\171\134\x61\x5c\x42\134\147\134\150\x5c\x48\x5c\151\134\163\x5c\165\134\145\134\x49\134\x4f\x5c\x50\134\124\134\132\134\143\x5c\x72\134\165"); $this->assertEquals($expected, $actual); $expected = "\171\x79\x79\171\x2d\115\115\x2d\144\144\47\124\47\x48\110\x3a\x6d\155\x3a\163\x73\x78\x78\x78"; $actual = FormatConverter::convertDatePhpToIcu("\143"); $this->assertEquals($expected, $actual); } public function providerForPHP2ICUPatterns() { return array("\163\151\x6e\147\154\145\40\47\x20\163\x68\157\x75\x6c\x64\x20\142\145\40\145\156\x63\157\x64\145\x64\40\x61\163\x20\x27\x27\54\40\167\x68\151\143\150\x20\x69\156\164\145\x72\156\141\x6c\x6c\171\x20\x73\x68\157\x75\x6c\x64\x20\142\145\40\145\156\143\x6f\x64\x65\x64\40\141\163\x20\47\47\x27\47" => array("\x27", "\47\x27"), "\x5c\144" => array("\x5c\x64", "\x27\x64\47"), "\x44\141\171\x20\157\x66\40\x74\x68\145\x20\x6d\157\156\x74\x68\x2c\40\62\40\144\151\147\x69\164\163\x20\167\151\164\x68\x20\154\x65\x61\x64\x69\156\x67\40\x7a\x65\162\157\x73\40\60\61\40\x74\157\40\x33\61" => array("\x64", "\x64\x64"), "\x5c\x44" => array("\x5c\104", "\47\x44\x27"), "\x41\x20\x74\145\170\x74\x75\141\154\x20\x72\x65\x70\x72\145\x73\145\x6e\x74\141\164\x69\157\x6e\x20\x6f\146\40\x61\x20\144\141\x79\54\x20\x74\150\162\x65\x65\40\154\145\x74\164\145\162\163\40\x4d\x6f\156\x20\x74\x68\162\x6f\165\147\x68\x20\x53\165\x6e" => array("\104", "\x65\x65\145"), "\134\x6a" => array("\134\x6a", "\x27\x6a\47"), "\x44\x61\171\40\x6f\x66\x20\164\x68\145\40\x6d\x6f\x6e\164\150\x20\x77\x69\164\x68\157\165\164\x20\x6c\x65\x61\x64\151\156\x67\x20\x7a\x65\162\x6f\163\40\x31\40\x74\157\x20\63\61" => array("\x6a", "\144"), "\134\154" => array("\x5c\154", "\x27\154\x27"), "\x41\x20\146\x75\x6c\x6c\x20\164\x65\170\x74\165\x61\154\40\162\145\x70\162\145\163\x65\156\x74\141\x74\151\x6f\x6e\x20\157\146\x20\x74\150\145\40\144\141\171\40\x6f\x66\x20\164\x68\145\40\x77\145\x65\153\40\x53\x75\156\144\141\x79\40\164\150\162\157\x75\x67\150\x20\x53\141\x74\165\x72\144\x61\171" => array("\154", "\x65\145\145\x65"), "\x5c\x4e" => array("\134\116", "\47\116\x27"), "\x49\x53\117\x2d\x38\x36\60\61\40\x6e\165\155\x65\x72\151\x63\x20\162\145\x70\162\x65\163\145\156\x74\x61\x74\151\157\x6e\40\x6f\x66\40\164\x68\x65\40\144\x61\171\40\x6f\x66\x20\164\x68\145\x20\x77\x65\145\x6b\x2c\x20\61\x20\50\146\x6f\162\40\x4d\x6f\x6e\144\141\x79\x29\40\164\150\x72\157\x75\x67\x68\x20\67\x20\50\x66\x6f\162\40\123\165\156\144\x61\171\51" => array("\116", "\x65"), "\134\123" => array("\134\123", "\x27\123\x27"), "\105\156\147\x6c\x69\163\x68\x20\157\x72\144\151\x6e\141\154\x20\x73\165\x66\x66\151\170\40\x66\157\x72\x20\x74\x68\x65\40\144\141\x79\x20\157\x66\x20\x74\x68\x65\x20\155\157\156\164\x68\54\x20\62\40\x63\150\x61\x72\x61\x63\x74\x65\x72\x73\40\x9\x73\164\54\x20\156\x64\x2c\40\x72\144\x20\x6f\x72\x20\x74\150\x2e\x20\127\x6f\162\153\x73\40\x77\145\x6c\154\40\x77\x69\x74\x68\x20\x6a" => array("\123", ''), "\x5c\x77" => array("\x5c\167", "\x27\167\47"), "\116\x75\x6d\145\162\x69\143\40\162\145\160\x72\x65\163\x65\x6e\x74\x61\x74\x69\x6f\156\40\157\x66\x20\x74\150\x65\40\144\x61\x79\40\x6f\146\40\164\x68\x65\40\x77\145\145\x6b\40\x9\60\x20\x28\x66\x6f\162\x20\123\x75\156\144\141\x79\x29\40\x74\x68\x72\157\165\147\x68\40\x36\40\50\146\157\x72\x20\123\141\x74\165\162\x64\141\x79\51" => array("\167", ''), "\134\172" => array("\134\172", "\47\x7a\47"), "\x54\150\145\x20\x64\x61\171\40\157\146\40\x74\x68\145\40\171\145\141\162\40\50\163\x74\141\162\x74\151\156\147\x20\x66\162\x6f\155\40\x30\x29\40\60\40\x74\150\x72\157\165\x67\150\x20\x33\x36\65" => array("\x7a", "\104"), "\x5c\127" => array("\x5c\x57", "\x27\127\x27"), "\x49\x53\x4f\x2d\x38\66\60\x31\x20\167\x65\145\153\40\x6e\x75\155\142\145\162\x20\x6f\x66\x20\x79\145\141\x72\x2c\40\167\x65\145\153\x73\40\x73\x74\x61\x72\164\x69\x6e\x67\x20\157\x6e\40\x4d\x6f\156\x64\x61\171\40\50\141\x64\x64\x65\144\40\x69\156\40\x50\x48\x50\40\x34\56\x31\56\60\51\40\x45\x78\141\x6d\160\154\x65\x3a\40\x34\62\40\50\164\150\x65\x20\64\x32\156\144\40\x77\x65\x65\x6b\x20\151\x6e\40\x74\150\x65\x20\171\x65\x61\162\51" => array("\127", "\x77"), "\134\106" => array("\x5c\106", "\x27\106\47"), "\101\x20\146\x75\154\154\x20\164\145\170\164\165\x61\154\x20\162\x65\x70\x72\145\x73\145\156\164\x61\164\x69\x6f\156\x20\157\146\x20\x61\40\x6d\x6f\156\x74\x68\54\40\x4a\x61\x6e\x75\141\162\171\x20\x74\150\x72\x6f\x75\x67\150\40\104\x65\143\x65\155\142\145\162" => array("\x46", "\115\x4d\115\x4d"), "\134\155" => array("\134\x6d", "\47\x6d\x27"), "\116\x75\155\x65\162\151\143\40\x72\145\160\x72\x65\x73\145\156\x74\x61\x74\x69\157\x6e\x20\157\x66\x20\x61\x20\155\x6f\156\164\x68\x2c\x20\x77\x69\x74\150\40\154\145\x61\144\151\x6e\x67\x20\x7a\145\162\157\163\x20\60\61\x20\164\x68\162\157\165\x67\x68\40\61\x32" => array("\155", "\115\115"), "\x5c\115" => array("\x5c\115", "\x27\115\x27"), "\101\x20\163\x68\x6f\162\x74\40\x74\145\170\164\x75\141\x6c\x20\x72\145\160\x72\x65\x73\x65\156\x74\x61\x74\x69\x6f\x6e\40\x6f\x66\x20\141\x20\x6d\157\156\x74\x68\54\x20\x74\150\x72\145\145\x20\154\x65\x74\164\x65\162\163\40\112\141\156\40\164\x68\162\157\165\147\150\x20\104\x65\143" => array("\115", "\x4d\115\x4d"), "\134\x6e" => array("\x5c\x6e", "\x27\x6e\47"), "\116\x75\x6d\145\x72\x69\x63\40\162\x65\x70\x72\145\x73\x65\156\164\x61\x74\151\x6f\x6e\x20\157\x66\x20\x61\x20\155\x6f\156\x74\150\x2c\x20\x77\151\164\150\x6f\x75\x74\40\154\145\x61\x64\x69\156\147\40\x7a\145\162\157\163\40\x31\40\x74\x68\x72\x6f\x75\x67\x68\40\x31\x32\x2c\40\156\x6f\164\40\163\x75\x70\x70\157\x72\x74\x65\144\x20\x62\171\x20\111\103\x55\x20\142\x75\164\40\167\x65\x20\146\141\x6c\x6c\x62\141\x63\x6b\40\164\x6f\x20\x22\167\x69\x74\150\40\154\145\x61\144\x69\x6e\x67\40\x7a\145\x72\157\x22" => array("\156", "\115"), "\134\x74" => array("\x5c\x74", "\x27\164\47"), "\x4e\165\155\x62\145\162\40\157\146\x20\x64\x61\x79\163\x20\x69\156\x20\x74\150\145\40\x67\151\166\x65\156\x20\x6d\157\156\164\x68\x20\x32\70\x20\x74\x68\162\x6f\165\x67\150\40\x33\x31" => array("\164", ''), "\134\114" => array("\x5c\114", "\x27\114\x27"), "\127\x68\x65\x74\x68\x65\162\x20\151\164\140\x73\40\141\40\x6c\145\x61\160\x20\x79\145\141\162\54\x20\61\40\151\146\40\151\x74\x20\151\x73\x20\x61\x20\154\x65\141\x70\40\x79\x65\141\x72\54\40\x30\40\x6f\164\150\x65\162\167\x69\163\145\x2e" => array("\114", ''), "\x5c\x6f" => array("\x5c\157", "\47\x6f\47"), "\x49\123\117\x2d\70\x36\x30\61\40\171\145\141\162\40\x6e\165\x6d\x62\x65\x72\56\40\x54\150\x69\x73\x20\x68\141\x73\x20\164\x68\145\40\163\141\x6d\145\40\166\x61\154\165\145\x20\x61\163\x20\131\x2c\40\x65\170\143\145\x70\164\40\x74\150\141\164\40\x69\146\x20\x74\x68\x65\x20\111\x53\x4f\x20\x77\145\145\x6b\40\156\165\155\x62\145\x72\40\50\x57\x29\40\x62\x65\x6c\157\x6e\147\163\40\x74\x6f\40\x74\x68\x65\40\160\x72\x65\x76\x69\x6f\165\163\x20\157\x72\40\x6e\x65\170\x74\x20\x79\x65\x61\162\54\40\164\150\141\x74\40\x79\145\x61\x72\x20\x69\x73\40\x75\x73\x65\x64\x20\151\x6e\163\164\x65\141\x64\56" => array("\157", "\131"), "\x5c\x59" => array("\134\x59", "\x27\131\x27"), "\101\x20\146\165\154\154\x20\156\x75\155\x65\162\151\x63\40\x72\145\x70\x72\145\163\x65\x6e\164\x61\x74\x69\x6f\156\x20\x6f\146\40\x61\40\x79\x65\141\162\x2c\x20\64\x20\144\151\x67\151\x74\x73\x20\105\170\141\155\160\x6c\x65\163\x3a\x20\61\71\x39\x39\x20\x6f\x72\x20\62\60\x30\x33" => array("\x59", "\x79\171\171\171"), "\x5c\x79" => array("\x5c\x79", "\47\x79\47"), "\x41\x20\164\167\157\x20\x64\x69\147\151\164\x20\162\145\x70\x72\145\163\145\x6e\x74\141\x74\151\x6f\156\40\157\146\x20\141\40\x79\145\x61\x72\x20\105\170\x61\155\160\154\x65\163\72\x20\x39\x39\40\x6f\x72\x20\60\63" => array("\x79", "\x79\x79"), "\x5c\x61" => array("\x5c\141", "\x27\x61\x27"), "\114\157\167\145\162\x63\x61\x73\x65\40\x41\156\x74\x65\x20\155\145\162\151\x64\x69\145\x6d\x20\141\x6e\144\x20\x50\157\x73\164\40\155\x65\x72\x69\144\151\x65\x6d\x2c\40\x61\155\x20\157\x72\40\160\x6d" => array("\x61", "\x61"), "\x5c\101" => array("\134\x41", "\x27\101\x27"), "\x55\160\160\x65\162\x63\141\163\145\40\101\x6e\164\145\x20\x6d\x65\x72\151\144\151\x65\155\x20\x61\x6e\144\40\x50\157\163\x74\x20\155\145\162\x69\x64\x69\x65\155\x2c\x20\101\x4d\40\x6f\x72\x20\x50\x4d\54\x20\x6e\x6f\164\x20\163\165\x70\160\x6f\x72\164\145\144\x20\142\171\40\x49\103\x55\x20\x62\165\x74\40\167\145\x20\x66\x61\x6c\x6c\x62\141\143\x6b\40\164\157\40\x6c\x6f\167\145\162\143\141\x73\145" => array("\101", "\x61"), "\x5c\102" => array("\134\102", "\x27\102\x27"), "\134\101\x5c\x42" => array("\x5c\x41\x5c\102", "\47\101\102\x27"), "\x53\167\x61\x74\x63\x68\x20\x49\156\164\x65\162\x6e\145\x74\x20\164\151\155\145\x20\60\60\x30\40\x74\x68\162\x6f\x75\147\x68\40\71\71\x39" => array("\102", ''), "\x5c\x67" => array("\x5c\147", "\x27\147\x27"), "\61\62\55\150\157\x75\x72\x20\146\x6f\x72\x6d\x61\164\x20\157\146\x20\141\156\40\150\x6f\165\x72\x20\167\151\164\x68\157\x75\164\x20\x6c\145\x61\144\x69\156\147\x20\x7a\x65\x72\157\x73\x20\x31\x20\164\x68\x72\x6f\x75\x67\150\x20\x31\x32" => array("\147", "\x68"), "\x5c\x47" => array("\x5c\107", "\x27\x47\x27"), "\x32\x34\x2d\150\x6f\165\x72\40\146\157\162\x6d\141\164\40\157\146\x20\x61\x6e\40\x68\157\165\x72\40\x77\151\164\150\x6f\x75\x74\40\x6c\145\x61\144\x69\x6e\147\x20\x7a\x65\x72\x6f\163\40\60\40\164\157\40\62\x33\x68" => array("\x47", "\110"), "\x5c\150" => array("\134\150", "\47\x68\x27"), "\61\62\x2d\150\x6f\165\162\40\146\157\162\155\141\164\40\x6f\x66\40\141\x6e\x20\150\157\165\162\x20\167\151\x74\150\x20\154\x65\x61\x64\x69\156\147\40\x7a\145\x72\x6f\163\x2c\x20\x30\x31\x20\164\157\40\x31\x32\40\x68" => array("\150", "\150\x68"), "\134\x48" => array("\134\x48", "\x27\110\47"), "\62\64\55\x68\157\165\x72\x20\146\157\162\x6d\x61\164\x20\157\x66\x20\141\x6e\x20\x68\157\165\162\x20\x77\x69\x74\150\40\154\145\141\x64\151\156\x67\40\172\x65\x72\x6f\163\54\40\60\60\40\164\x6f\40\62\x33\40\150" => array("\x48", "\x48\x48"), "\x5c\x69" => array("\134\151", "\47\x69\x27"), "\x4d\x69\x6e\165\x74\145\x73\40\x77\151\x74\150\40\154\145\141\144\151\x6e\x67\40\x7a\145\162\157\163\40\x30\60\40\x74\x6f\x20\x35\x39" => array("\151", "\155\x6d"), "\134\163" => array("\134\x73", "\x27\x73\x27"), "\x53\x65\x63\157\x6e\144\x73\54\x20\x77\151\x74\x68\40\154\x65\141\144\x69\x6e\x67\x20\172\145\162\x6f\x73\40\60\60\40\164\150\162\x6f\165\x67\x68\x20\x35\71" => array("\x73", "\x73\163"), "\134\x75" => array("\x5c\165", "\x27\x75\x27"), "\x4d\151\143\x72\157\163\145\143\x6f\156\144\x73\56\40\x45\x78\141\x6d\160\x6c\145\x3a\40\66\x35\64\63\x32\x31" => array("\x75", ''), "\134\x65" => array("\134\x65", "\x27\145\x27"), "\x54\x69\155\145\x7a\157\x6e\145\x20\151\x64\x65\x6e\164\151\x66\151\x65\162\56\40\x45\x78\141\x6d\160\x6c\x65\x73\72\40\125\124\103\x2c\x20\107\115\124\54\x20\101\164\154\141\x6e\164\x69\143\x2f\x41\x7a\x6f\162\145\163" => array("\145", "\x56\126"), "\134\111" => array("\x5c\x49", "\x27\x49\x27"), "\x57\150\145\164\150\145\162\40\x6f\x72\x20\156\x6f\x74\40\164\150\x65\x20\144\141\x74\145\40\151\x73\40\151\156\x20\x64\x61\171\x6c\151\147\150\x74\40\163\141\166\x69\x6e\x67\x20\164\151\155\145\x2c\x20\x31\x20\151\146\40\104\x61\171\x6c\x69\x67\x68\x74\x20\x53\141\166\151\156\x67\x20\x54\151\x6d\145\54\x20\x30\40\157\x74\150\145\162\167\151\163\145\x2e" => array("\x49", ''), "\134\117" => array("\x5c\x4f", "\x27\x4f\47"), "\104\x69\x66\146\x65\162\145\156\143\145\x20\x74\x6f\x20\x47\162\x65\145\x6e\x77\x69\143\x68\40\164\x69\x6d\145\40\50\107\x4d\124\x29\x20\x69\x6e\40\x68\157\x75\162\163\54\40\105\x78\x61\x6d\160\x6c\x65\72\40\53\x30\x32\x30\x30" => array("\x4f", "\170\x78"), "\x5c\x50" => array("\x5c\x50", "\x27\120\x27"), "\x44\x69\x66\x66\x65\162\145\x6e\x63\145\x20\x74\157\x20\107\x72\145\145\156\x77\151\x63\150\x20\164\x69\155\145\40\50\x47\x4d\124\51\40\167\x69\x74\150\x20\143\157\x6c\157\156\40\x62\145\x74\167\x65\x65\x6e\40\150\157\x75\x72\x73\40\141\156\x64\x20\x6d\x69\x6e\x75\164\x65\x73\54\40\105\170\x61\x6d\160\154\x65\x3a\40\53\x30\x32\x3a\60\x30" => array("\x50", "\170\x78\x78"), "\x5c\x54" => array("\x5c\x54", "\x27\124\47"), "\124\151\x6d\x65\x7a\x6f\156\145\40\x61\142\142\162\x65\x76\151\x61\x74\x69\157\156\54\x20\x45\x78\141\155\x70\154\x65\163\x3a\40\x45\x53\x54\x2c\40\115\104\x54\x20\56\x2e\x2e" => array("\x54", "\172\172\x7a"), "\134\x5a" => array("\x5c\132", "\47\132\47"), "\124\x69\155\145\172\x6f\156\x65\x20\157\x66\146\163\x65\x74\x20\x69\x6e\40\x73\145\143\157\156\x64\163\x2e\40\x54\150\x65\x20\157\146\146\163\145\x74\40\146\x6f\x72\x20\164\x69\155\x65\x7a\x6f\x6e\x65\x73\40\167\145\163\164\40\157\146\x20\x55\124\x43\40\151\163\40\x61\154\167\x61\171\163\x20\x6e\145\147\141\164\151\x76\x65\54\40\x61\x6e\x64\40\146\x6f\x72\x20\x74\150\157\163\145\40\x65\141\163\x74\x20\x6f\146\40\x55\124\x43\40\151\x73\x20\141\x6c\167\141\171\163\x20\160\157\x73\x69\164\x69\166\x65\x2e\40\55\64\63\x32\x30\x30\x20\x74\150\162\x6f\165\147\x68\x20\65\x30\64\x30\x30" => array("\132", ''), "\134\143" => array("\134\143", "\x27\x63\47"), "\x49\123\117\40\70\66\x30\61\40\x64\141\x74\145\54\40\145\x2e\x67\56\x20\62\x30\60\64\x2d\x30\x32\55\61\62\x54\61\65\72\61\x39\x3a\62\61\53\60\60\72\x30\60" => array("\143", "\171\x79\x79\x79\x2d\x4d\x4d\x2d\144\144\x27\124\x27\x48\x48\72\155\x6d\72\163\163\x78\170\x78"), "\134\162" => array("\x5c\x72", "\x27\162\x27"), "\122\106\x43\40\x32\70\x32\62\40\x66\157\x72\155\x61\x74\164\145\x64\40\x64\141\164\x65\54\40\x45\x78\x61\x6d\160\x6c\145\72\x20\124\x68\165\x2c\40\x32\x31\40\x44\145\x63\40\62\60\60\60\x20\x31\66\x3a\60\x31\x3a\60\67\40\x2b\60\x32\x30\60" => array("\x72", "\x65\x65\145\54\x20\144\x64\x20\x4d\115\115\40\x79\171\x79\171\x20\x48\110\x3a\155\x6d\72\163\163\x20\170\x78"), "\134\x55" => array("\134\125", "\47\x55\x27"), "\x53\x65\143\x6f\x6e\x64\163\x20\x73\x69\x6e\143\x65\40\x74\150\x65\x20\125\156\151\x78\40\105\160\157\143\x68\40\x28\112\x61\156\165\x61\x72\171\x20\61\x20\x31\x39\67\x30\x20\60\x30\x3a\x30\60\72\60\60\40\x47\115\124\x29" => array("\125", ''), "\134" => array("\134\134", "\x5c")); } public function testPhpToICUSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDatePhpToIcu($pattern)); } public function testPhpFormatC() { $time = time(); $formatter = new Formatter(array("\154\157\x63\141\154\x65" => "\x65\x6e\x2d\125\123")); $this->assertEquals(date("\143", $time), $formatter->asDatetime($time, "\x70\150\160\72\143")); date_default_timezone_set("\x45\x75\x72\x6f\160\x65\57\x4d\x6f\x73\143\157\167"); $formatter = new Formatter(array("\154\x6f\x63\141\x6c\x65" => "\162\x75\x2d\122\x55", "\x74\151\155\145\132\157\156\145" => "\x45\x75\x72\157\160\x65\57\x4d\x6f\x73\143\x6f\167")); $this->assertEquals(date("\143", $time), $formatter->asDatetime($time, "\x70\150\x70\72\143")); } public function testEscapedPhpToJuiMixedPatterns() { $this->assertEquals("\144\144\55\155\x6d\x2d\171\x79", FormatConverter::convertDatePhpToJui("\x64\x2d\155\x2d\x59")); } public function providerForPHP2JUIPatterns() { return array("\104\x61\x79\x20\x6f\146\40\x74\150\145\x20\155\157\156\x74\x68\x2c\40\62\x20\x64\x69\147\151\164\163\x20\167\151\164\150\x20\x6c\145\141\144\x69\x6e\147\x20\172\145\x72\x6f\x73\40\x9\x30\x31\40\164\x6f\x20\x33\61" => array("\144", "\144\144"), "\101\40\164\x65\170\164\x75\141\x6c\x20\x72\x65\160\x72\145\163\x65\156\x74\x61\164\x69\x6f\156\x20\157\146\x20\x61\40\x64\x61\171\x2c\40\164\150\162\x65\x65\40\x6c\145\x74\x74\x65\162\x73\x20\11\x4d\157\156\x20\164\150\x72\x6f\165\x67\150\x20\123\x75\156" => array("\104", "\104"), "\104\141\171\40\157\x66\40\164\x68\145\x20\155\x6f\156\x74\150\x20\x77\151\x74\150\157\165\x74\40\154\x65\x61\144\x69\x6e\147\40\x7a\x65\162\157\163\x20\61\x20\x74\x6f\x20\63\61" => array("\152", "\144"), "\101\40\x66\165\154\154\40\x74\x65\x78\x74\165\x61\x6c\40\162\x65\160\162\x65\163\145\x6e\164\141\x74\151\x6f\156\x20\x6f\146\40\164\150\x65\40\144\x61\x79\40\157\146\x20\x74\x68\x65\x20\167\x65\145\x6b\40\x53\165\156\x64\141\171\40\164\150\162\157\165\x67\150\40\123\x61\164\165\x72\x64\x61\x79" => array("\154", "\104\104"), "\111\x53\117\x2d\x38\66\60\61\x20\x6e\165\x6d\145\162\151\x63\40\x72\x65\x70\162\145\163\145\156\x74\141\x74\151\x6f\156\x20\x6f\x66\x20\164\x68\145\40\x64\x61\171\x20\157\x66\40\x74\150\x65\40\167\145\145\x6b\x2c\40\61\40\x28\x66\x6f\x72\40\x4d\x6f\156\x64\x61\171\x29\40\x74\x68\162\x6f\x75\x67\x68\x20\67\x20\x28\x66\157\162\40\123\x75\x6e\144\141\x79\51" => array("\116", ''), "\105\x6e\147\x6c\151\163\150\40\x6f\x72\x64\151\x6e\x61\x6c\x20\163\x75\x66\146\151\170\x20\146\157\162\x20\164\150\145\x20\x64\141\171\40\157\x66\40\164\150\145\x20\155\x6f\x6e\x74\x68\x2c\40\x32\40\143\150\x61\x72\x61\143\164\x65\162\163\40\11\x73\164\54\40\156\144\x2c\x20\162\x64\40\x6f\162\40\164\150\56\40\127\x6f\x72\x6b\x73\40\x77\x65\154\x6c\x20\167\151\x74\150\40\x6a" => array("\123", ''), "\x4e\x75\x6d\x65\162\151\x63\40\x72\x65\x70\162\145\x73\145\x6e\x74\141\x74\x69\x6f\156\x20\157\146\x20\164\150\145\x20\x64\141\171\40\157\x66\40\x74\x68\145\x20\167\145\x65\x6b\x20\60\40\x28\146\157\162\x20\x53\165\156\144\141\171\x29\x20\x74\150\162\157\x75\x67\150\40\x36\40\50\x66\157\x72\x20\x53\141\x74\x75\162\x64\x61\171\x29" => array("\x77", ''), "\124\x68\145\x20\x64\141\x79\40\157\146\40\164\x68\x65\40\x79\x65\141\x72\x20\x28\x73\164\x61\162\164\x69\x6e\x67\x20\x66\x72\x6f\x6d\40\60\51\x20\60\x20\x74\150\162\x6f\x75\x67\x68\x20\x33\66\65" => array("\172", "\x6f"), "\111\x53\x4f\x2d\70\66\x30\x31\40\167\x65\145\153\40\x6e\165\155\x62\145\162\40\x6f\x66\x20\x79\x65\x61\162\54\40\x77\145\x65\153\163\x20\163\164\141\x72\164\x69\x6e\147\40\x6f\x6e\40\115\157\156\x64\141\171\40\50\x61\x64\144\x65\144\40\x69\156\x20\120\x48\x50\x20\64\x2e\61\x2e\60\51\x20\105\x78\x61\155\x70\154\x65\x3a\x20\64\x32\x20\50\164\x68\x65\40\x34\62\x6e\144\40\x77\145\x65\153\40\x69\156\40\164\x68\145\40\171\145\141\162\x29" => array("\x57", ''), "\101\x20\x66\x75\x6c\154\40\x74\x65\x78\x74\165\141\154\40\x72\145\160\x72\145\163\145\156\164\141\164\151\x6f\156\x20\x6f\146\x20\141\x20\155\x6f\x6e\x74\x68\x2c\40\x4a\x61\156\165\x61\162\171\x20\164\150\162\157\x75\147\150\40\x44\145\143\x65\x6d\x62\145\x72" => array("\106", "\115\115"), "\x4e\x75\155\145\162\x69\143\40\x72\x65\x70\162\145\x73\145\x6e\x74\x61\x74\x69\x6f\x6e\x20\x6f\x66\x20\141\40\x6d\x6f\x6e\164\x68\54\x20\167\x69\164\150\x20\x6c\145\141\144\151\156\x67\40\172\145\x72\x6f\x73\x20\60\x31\x20\164\150\162\157\x75\147\x68\x20\61\62" => array("\155", "\x6d\x6d"), "\101\x20\x73\x68\x6f\162\x74\40\164\145\x78\164\x75\141\x6c\x20\x72\x65\160\162\x65\x73\x65\156\164\x61\164\x69\157\x6e\40\157\x66\x20\x61\x20\155\157\156\x74\x68\54\40\x74\x68\162\x65\x65\x20\x6c\145\164\164\x65\x72\163\x20\112\141\156\40\x74\x68\x72\x6f\x75\x67\x68\40\104\x65\143" => array("\x4d", "\x4d"), "\116\165\x6d\x65\162\x69\143\40\162\145\160\x72\145\163\x65\x6e\164\141\164\151\x6f\x6e\x20\157\x66\40\141\40\155\x6f\x6e\x74\150\54\x20\x77\x69\164\150\x6f\x75\x74\40\154\x65\x61\144\x69\x6e\x67\40\x7a\x65\162\157\163\x20\x31\40\164\x68\x72\157\165\x67\150\x20\61\62" => array("\x6e", "\155"), "\x4e\x75\x6d\142\145\162\x20\157\146\x20\144\x61\x79\163\x20\151\x6e\x20\164\x68\145\40\147\x69\166\x65\x6e\x20\x6d\157\x6e\x74\150\x20\11\62\x38\40\164\x68\x72\x6f\165\x67\x68\40\x33\x31" => array("\x74", ''), "\127\x68\145\164\x68\x65\x72\x20\151\x74\140\163\x20\141\40\x6c\x65\141\x70\40\x79\x65\141\162\54\x20\61\x20\151\x66\x20\151\164\40\151\x73\40\141\x20\154\x65\x61\x70\40\x79\145\x61\x72\x2c\x20\60\40\x6f\x74\x68\x65\x72\x77\151\x73\145\x2e" => array("\114", ''), "\x49\123\x4f\x2d\x38\66\60\61\40\x79\145\x61\162\40\156\x75\x6d\x62\x65\x72\x2e\x20\x54\150\x69\163\x20\150\141\163\x20\164\x68\145\40\x73\x61\155\145\x20\x76\141\154\165\145\40\141\163\x20\x59\x2c\x20\145\170\x63\x65\160\x74\x20\164\150\141\164\40\151\146\40\164\x68\145\x20\111\x53\117\x20\x77\145\145\x6b\x20\156\165\x6d\x62\145\162\40\50\127\51\40\142\x65\154\157\x6e\x67\x73\40\x74\x6f\x20\164\x68\145\40\x70\162\x65\166\x69\x6f\x75\x73\40\x6f\162\40\x6e\x65\x78\164\40\171\145\x61\162\x2c\40\164\x68\141\164\40\x79\145\141\x72\40\151\x73\x20\165\x73\145\x64\x20\x69\x6e\163\164\x65\141\x64\56" => array("\157", ''), "\101\x20\x66\165\x6c\154\x20\x6e\x75\x6d\145\162\151\x63\x20\162\x65\160\162\x65\163\x65\156\x74\x61\x74\151\x6f\156\40\x6f\x66\40\141\x20\x79\x65\x61\162\54\40\64\x20\x64\151\147\151\164\x73\40\11\x45\x78\x61\155\160\x6c\145\x73\x3a\40\x31\x39\x39\x39\x20\x6f\x72\40\62\60\x30\x33" => array("\x59", "\x79\171"), "\x41\40\x74\167\x6f\x20\144\x69\147\151\x74\x20\162\145\160\162\145\x73\145\156\x74\141\164\151\157\x6e\40\157\146\x20\x61\x20\x79\145\141\x72\x20\x45\170\141\155\x70\154\x65\163\x3a\x20\71\x39\x20\157\x72\x20\60\x33" => array("\171", "\x79"), "\x4c\x6f\167\x65\162\143\141\x73\145\x20\x41\x6e\x74\x65\x20\x6d\145\162\x69\144\151\x65\155\x20\x61\x6e\x64\40\x50\157\x73\164\x20\155\x65\162\x69\144\151\145\x6d\x2c\40\x61\155\40\x6f\x72\40\x70\155" => array("\x61", ''), "\125\x70\160\x65\162\143\141\163\145\x20\101\x6e\x74\x65\40\155\145\x72\x69\x64\151\145\x6d\40\141\x6e\x64\x20\120\157\163\164\x20\155\x65\162\x69\x64\x69\145\155\x2c\x20\101\115\x20\157\x72\40\x50\115\x2c\40\156\x6f\x74\40\163\165\x70\160\157\162\x74\145\x64\x20\x62\x79\x20\x49\103\x55\40\x62\165\x74\40\x77\x65\x20\x66\141\154\x6c\142\x61\x63\x6b\x20\164\x6f\40\154\157\167\145\162\x63\141\163\145" => array("\101", ''), "\123\x77\141\164\143\150\x20\111\156\x74\145\x72\x6e\145\164\x20\x74\151\x6d\145\x20\x30\x30\x30\x20\x74\150\162\157\x75\x67\x68\40\71\x39\71" => array("\x42", ''), "\x31\x32\x2d\x68\157\165\x72\x20\146\x6f\162\x6d\x61\164\x20\x6f\x66\x20\x61\156\40\150\157\165\x72\40\167\x69\164\x68\x6f\x75\x74\x20\154\x65\141\x64\x69\x6e\147\40\x7a\x65\162\157\163\40\61\x20\164\150\162\157\x75\147\150\x20\x31\x32" => array("\147", ''), "\x32\64\x2d\x68\x6f\x75\x72\40\x66\157\x72\155\141\164\x20\x6f\x66\40\141\x6e\x20\x68\157\x75\x72\x20\x77\x69\164\x68\x6f\165\x74\x20\x6c\x65\141\144\x69\156\147\x20\x7a\145\x72\x6f\x73\40\x30\40\164\x6f\x20\62\x33\x68" => array("\107", ''), "\61\62\x2d\x68\x6f\165\x72\40\x66\x6f\x72\155\141\164\40\x6f\146\40\x61\x6e\x20\x68\157\165\162\x20\x77\x69\x74\150\x20\x6c\x65\x61\144\x69\156\147\40\172\x65\x72\x6f\x73\x2c\40\x30\x31\40\x74\157\40\x31\62\x20\x68" => array("\x68", ''), "\x32\64\x2d\x68\x6f\x75\162\40\146\157\162\155\x61\x74\40\157\x66\40\x61\156\40\150\157\165\x72\x20\167\x69\164\x68\40\x6c\145\x61\x64\x69\156\147\x20\172\145\x72\x6f\163\54\40\x30\x30\x20\164\157\x20\x32\63\40\150" => array("\x48", ''), "\115\151\156\165\164\x65\x73\40\167\151\x74\150\40\x6c\x65\141\x64\x69\156\x67\40\x7a\145\x72\x6f\x73\40\x30\x30\x20\164\157\40\65\x39" => array("\x69", ''), "\123\145\143\x6f\156\144\163\54\40\x77\151\164\150\x20\x6c\145\x61\x64\x69\156\147\40\x7a\145\162\x6f\x73\40\x30\60\40\x74\x68\x72\157\165\x67\150\40\x35\71" => array("\163", ''), "\x4d\151\143\x72\x6f\x73\145\x63\157\156\x64\163\x2e\40\x45\x78\141\x6d\160\154\x65\72\40\x36\x35\x34\x33\62\61" => array("\x75", ''), "\x54\x69\x6d\145\x7a\x6f\x6e\x65\x20\x69\x64\145\156\164\151\x66\x69\x65\x72\x2e\40\105\170\141\x6d\160\154\x65\x73\72\x20\x55\x54\103\54\x20\x47\x4d\124\54\x20\101\x74\x6c\x61\x6e\x74\x69\x63\x2f\x41\x7a\x6f\162\x65\x73" => array("\145", ''), "\127\150\x65\x74\150\145\162\40\x6f\x72\40\156\x6f\164\x20\164\x68\x65\x20\144\x61\164\x65\40\151\163\40\x69\156\x20\144\x61\171\154\151\x67\x68\x74\x20\x73\x61\x76\151\156\x67\x20\x74\151\155\145\x2c\40\x31\x20\151\x66\x20\x44\x61\x79\154\151\147\150\x74\40\123\141\166\x69\156\147\x20\124\x69\155\145\54\x20\60\x20\x6f\x74\150\145\x72\167\x69\x73\145\56" => array("\x49", ''), "\x44\x69\x66\x66\145\x72\145\156\x63\145\40\164\x6f\40\107\162\145\x65\x6e\x77\x69\x63\150\40\x74\151\155\x65\x20\x28\107\115\x54\x29\x20\151\156\x20\x68\157\165\162\x73\54\40\105\170\x61\x6d\160\x6c\x65\72\x20\53\x30\x32\x30\60" => array("\x4f", ''), "\104\151\x66\146\x65\x72\x65\x6e\143\x65\x20\164\157\40\107\x72\145\x65\156\x77\151\x63\150\40\x74\x69\155\x65\x20\x28\107\115\124\51\40\x77\x69\164\x68\40\x63\157\154\157\156\40\142\145\x74\x77\x65\145\156\40\x68\157\165\162\163\40\141\156\x64\40\x6d\x69\156\x75\164\x65\163\x2c\x20\105\x78\141\155\x70\x6c\145\72\x20\53\60\62\x3a\x30\x30" => array("\120", ''), "\x54\151\155\x65\172\x6f\156\145\40\x61\x62\142\162\x65\x76\151\141\164\x69\157\x6e\54\x20\105\170\x61\x6d\x70\154\x65\x73\72\40\105\123\x54\x2c\40\115\104\x54\40\x2e\x2e\x2e" => array("\124", ''), "\x54\151\x6d\145\172\157\x6e\x65\x20\x6f\x66\x66\163\145\x74\40\151\x6e\x20\163\145\143\x6f\x6e\x64\163\x2e\40\124\x68\145\x20\x6f\x66\x66\x73\x65\x74\40\x66\x6f\162\40\164\151\155\145\172\x6f\156\x65\163\x20\x77\x65\163\164\40\x6f\146\40\x55\x54\103\40\x69\163\x20\141\154\167\141\171\163\x20\x6e\x65\x67\141\164\151\x76\x65\x2c\x20\x61\x6e\x64\40\x66\x6f\x72\x20\x74\150\x6f\x73\x65\40\x65\x61\163\164\x20\157\x66\x20\x55\x54\x43\40\151\x73\40\141\154\x77\x61\x79\163\x20\x70\x6f\x73\151\164\x69\166\x65\x2e\40\55\x34\x33\62\60\x30\x20\164\x68\x72\157\165\147\x68\40\65\x30\x34\60\60" => array("\132", ''), "\x49\123\117\40\70\x36\60\61\x20\x64\141\x74\145\x2c\40\145\x2e\147\x2e\x20\x32\60\x30\x34\x2d\x30\x32\55\x31\x32\124\x31\x35\x3a\61\x39\72\x32\61\53\x30\60\x3a\x30\x30\54\x20\x73\x6b\x69\x70\x70\x69\x6e\x67\40\x74\x68\x65\40\164\151\155\x65\40\150\145\x72\x65\40\142\145\143\141\x75\163\x65\40\151\x74\40\151\163\40\156\x6f\x74\40\163\165\x70\x70\x6f\162\164\x65\144" => array("\143", "\x79\x79\x79\x79\55\x4d\115\x2d\x64\x64"), "\x52\x46\x43\40\62\70\62\x32\40\x66\157\x72\x6d\x61\x74\x74\145\x64\40\x64\x61\x74\145\x2c\x20\105\x78\141\155\x70\x6c\x65\x3a\40\124\x68\x75\54\40\x32\61\x20\104\x65\143\40\62\60\x30\60\40\x31\x36\x3a\x30\61\x3a\x30\x37\40\x2b\x30\x32\x30\x30\54\40\x73\153\151\x70\160\151\156\x67\x20\164\x68\x65\40\164\x69\155\145\40\150\145\162\145\x20\x62\145\x63\141\165\x73\x65\40\151\x74\40\x69\x73\40\x6e\157\x74\40\163\165\x70\160\157\x72\164\145\x64" => array("\162", "\104\x2c\40\x64\x20\115\40\x79\171"), "\x53\145\x63\x6f\156\x64\x73\x20\163\151\x6e\x63\145\40\164\x68\x65\x20\x55\x6e\151\x78\40\x45\160\157\x63\x68\40\x28\x4a\141\x6e\x75\141\x72\x79\40\x31\x20\61\71\x37\60\40\x30\x30\x3a\60\60\x3a\x30\x30\40\107\x4d\124\51" => array("\x55", "\100")); } public function testEscapedPhpToJuiSinglePattern($pattern, $expected) { $this->assertEquals($expected, FormatConverter::convertDatePhpToJui($pattern)); } }

Function Calls

None

Variables

None

Stats

MD5 4236bc882b06000174eb0b63cb9fddac
Eval Count 0
Decode Time 117 ms