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 5ae192b commit f440f06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Tests/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function testSymfonySerialize()
"subtype": "plain",
"disposition": null,
"name": null,
"encoding": "quoted-printable",
"encoding": "quoted-printable",%A
"headers": [],
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\TextPart"
},
Expand All @@ -211,7 +211,7 @@ public function testSymfonySerialize()
"subtype": "html",
"disposition": null,
"name": null,
"encoding": "quoted-printable",
"encoding": "quoted-printable",%A
"headers": [],
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\TextPart"
}
Expand All @@ -221,13 +221,13 @@ public function testSymfonySerialize()
},
{
"filename": "text.txt",
"mediaType": "application",
"mediaType": "application",%A
"body": "text data",
"charset": null,
"subtype": "octet-stream",
"disposition": "attachment",
"name": "text.txt",
"encoding": "base64",
"encoding": "base64",%A
"headers": [],
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\DataPart"
}
Expand All @@ -249,12 +249,12 @@ public function testSymfonySerialize()
], [new JsonEncoder()]);

$serialized = $serializer->serialize($e, 'json');
$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, Message::class, 'json');
$this->assertEquals($expected->getHeaders(), $n->getHeaders());

$serialized = $serializer->serialize($e, 'json');
$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));
}
}
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/property-access": "^5.4|^6.0",
"symfony/property-info": "^5.4|^6.0",
"symfony/serializer": "^5.4.14|~6.0.14|^6.1.6"
"symfony/serializer": "^5.2|^6.0"
},
"conflict": {
"egulias/email-validator": "~3.0.0",
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"symfony/mailer": "<5.4",
"symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6"
"symfony/mailer": "<5.4"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Mime\\": "" },
Expand Down

0 comments on commit f440f06

Please sign in to comment.