19 declare(strict_types=1);
32 $this->assertInstanceOf(LanguageTag::class, $tag);
35 #[\PHPUnit\Framework\Attributes\DataProvider('SaveToRun')] 36 public function testParse(
string $input,
bool $isOk): void
39 $this->expectException(NotOKException::class);
42 $this->assertInstanceOf(LanguageTag::class, $tag);
45 #[\PHPUnit\Framework\Attributes\DataProvider('risky')] 46 public function testRisky(
string $input,
bool $isOk): void
63 [
'aa-bbb-ccc-ddd',
true],
67 [
'aa-x-1234ab-d',
true],
69 [
'aaa-bbb-ccc',
true],
80 [
'cel-gaulish',
true],
81 [
'cmn-Hans-CN',
true],
87 [
'en-US-x-twain',
true],
115 [
'sl-IT-nedis',
true],
117 [
'sl-rozaj-biske',
true],
120 [
'sr-Latn-QM',
true],
121 [
'sr-Latn-RS',
true],
123 [
'sr-Qaaa-RS',
true],
124 [
'x-111-aaaaa-BBB',
true],
125 [
'x-whatever',
true],
127 [
'zh-Hans-CN',
true],
129 [
'zh-Hant-HK',
true],
131 [
'zh-cmn-Hans-CN',
true],
134 [
'zh-min-nan',
true],
145 public static function risky(): array
147 if (function_exists(
'xdebug_info') && ((
int) ini_get(
'xdebug.max_nesting_level')) < 780) {
148 self::markTestSkipped(sprintf(
149 'You are running under Xdebug. To be able to run all tests xdebug.max_nesting_level must be at least 780 (Currently %d).',
150 (
int) ini_get(
'xdebug.max_nesting_level')
155 [
'aa-bbb-ccc-1111-ccccc-b1b1b',
true],
156 [
'aaa-bbb-ccc-ddd-abcd-123-abc123-0abc-b-01-abc123-x-01ab-abc12',
true],
157 [
'az-Arab-x-AZE-derbend',
true],
158 [
'de-CH-x-phonebk',
true],
159 [
'de-DE-u-co-phonebk',
true],
160 [
'en-US-u-islamcal',
true],
161 [
'en-a-myext-b-another',
true],
162 [
'hy-Latn-IT-arevela',
true],
163 [
'qaa-Qaaa-QM-x-southern',
true],
164 [
'aa-7-123abc-abc-a-12',
true],
165 [
'aa-b1b1b-6a8b-cccccc',
true],
166 [
'zh-CN-a-myext-x-private',
true],
static fromString(string $string)
testRisky(string $input, bool $isOk)
testParse(string $input, bool $isOk)