8000 - · symfony/symfony@7635bcd · GitHub
[go: up one dir, main page]

Skip to content

Commit 7635bcd

Browse files
committed
-
1 parent ee89a98 commit 7635bcd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Symfony/Component/Validator/Tests/Constraints/CssColorValidatorTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,19 @@ public function getInvalidHSLA(): array
429429
];
430430
}
431431

432-
public function testUnknownFormatsOnValidateTriggerException()
432+
public function testUnknownFormatAsStringThrowsException()
433433
{
434-
$constraint = new CssColor('Unknown Format');
434+
$this->expectException(\InvalidArgumentException::class);
435+
$this->expectExceptionMessage('The "formats" parameter value is not valid. It must contain one or more of the following values: "hex_long, hex_long_with_alpha, hex_short, hex_short_with_alpha, basic_named_colors, extended_named_colors, system_colors, keywords, rgb, rgba, hsl, hsla".');
435436

437+
new CssColor('Unknown Format');
438+
}
439+
440+
public function testUnknownFormatAsArrayThrowsException()
441+
{
436442
$this->expectException(\InvalidArgumentException::class);
437443
$this->expectExceptionMessage('The "formats" parameter value is not valid. It must contain one or more of the following values: "hex_long, hex_long_with_alpha, hex_short, hex_short_with_alpha, basic_named_colors, extended_named_colors, system_colors, keywords, rgb, rgba, hsl, hsla".');
438444

439-
$this->validator->validate('#F4B907', $constraint);
445+
new CssColor(['Unknown Format']);
440446
}
441447
}

0 commit comments

Comments
 (0)
0