8000 [Serializer] Do not allow to denormalize string with spaces only to valid a DateTime object by sidz · Pull Request #41491 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Serializer] Do not allow to denormalize string with spaces only to valid a DateTime object #41491

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

Closed
Closed
Changes from 1 commit
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
Prev Previous commit
Fix expected message
  • Loading branch information
sidz committed Jun 3, 2021
commit c2a204945d648d2c16d32e79119b7fb141aa5a63
6CBB
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function testDenormalizeStringWithSpacesOnlyThrowsAnException()
public function testDenormalizeDateTimeStringWithSpacesUsingFormatPassedInContextThrowsAnException()
{
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage("Parsing datetime string \" 2016.01.01 \" using format \"Y.m.d|\" resulted in 2 errors:\nat position 0: Unexpected data found.\nat position 12: Trailing data");
$this->expectExceptionMessage("Parsing datetime string \" 2016.01.01 \" using format \"Y.m.d|\" resulted in 2 errors: \nat position 0: Unexpected data found.\nat position 12: Trailing data");
$this->normalizer->denormalize(' 2016.01.01 ', \DateTime::class, null, [DateTimeNormalizer::FORMAT_KEY => 'Y.m.d|']);
}

Expand Down
0