8000 Fix and add test by OskarStark · Pull Request #53176 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix and add test #53176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,22 @@ public function getInvalidHSLA(): array
return [['hsla(1000, 1000%, 20000%, 999)'], ['hsla(-100, -10%, -2%, 999)'], ['hsla(a, b, c, d)'], ['hsla(a, b%, c%, d)'], ['hsla( 9 99% , 99 9% , 9 %']];
}

public function testUnknownFormatsOnValidateTriggerException()
/**
* @dataProvider getInvalidFormats
*/
public function testUnknownFormatAsStringThrowsException($formats)
{
$this->expectException(\InvalidArgumentException::class);
$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".');
$constraint = new CssColor('Unknown Format');
$this->validator->validate('#F4B907', $constraint);

new CssColor($formats);
}

public static function getInvalidFormats(): array
{
return [
'as string' => ['Unknown Format'],
'as array' => [['Unknown Format']],
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,9 @@ public function testMaxSizeNotExceeded($bytesWritten, $limit)
public function testInvalidMaxSize()
{
$this->expectException(ConstraintDefinitionException::class);
$constraint = new File([
new File([
'maxSize' => '1abc',
]);

$this->validator->validate($this->path, $constraint);
}

public static function provideBinaryFormatTests()
Expand Down
0