Skip to content

Commit

Permalink
Relax tests to make them compatible with Mime v6.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Oct 19, 2022
1 parent 368e9ba commit 10f4ccb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Tests/Mime/TemplatedEmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ public function testSymfonySerialize()
"html": null,
"htmlCharset": null,
"attachments": [
{
"body": "Some Text file",
"name": "test.txt",
"content-type": null,
"inline": false
{%A
"body": "Some Text file",%A
"name": "test.txt",%A
}
],
"headers": {
Expand Down Expand Up @@ -111,11 +109,11 @@ public function testSymfonySerialize()
], [new JsonEncoder()]);

$serialized = $serializer->serialize($e, 'json', [ObjectNormalizer::IGNORED_ATTRIBUTES => ['cachedBody']]);
$this->assertSame($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
$this->assertStringMatchesFormat($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));

$n = $serializer->deserialize($serialized, TemplatedEmail::class, 'json');
$serialized = $serializer->serialize($e, 'json', [ObjectNormalizer::IGNORED_ATTRIBUTES => ['cachedBody']]);
$this->assertSame($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
$this->assertStringMatchesFormat($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));

$n->from('fabien@symfony.com');
$expected->from('fabien@symfony.com');
Expand Down

0 comments on commit 10f4ccb

Please sign in to comment.