10000 minor #47911 Relax tests to make them compatible with Mime v6.2+ (nic… · symfony/symfony@b46c293 · GitHub
[go: up one dir, main page]

Skip to content

Commit b46c293

Browse files
minor #47911 Relax tests to make them compatible with Mime v6.2+ (nicolas-grekas)
This PR was merged into the 6.1 branch. Discussion ---------- Relax tests to make them compatible with Mime v6.2+ | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- b0bfa5c Relax tests to make them compatible with Mime v6.2+
2 parents 6037db9 + b0bfa5c commit b46c293

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

src/Symfony/Bridge/Twig/Tests/Mime/TemplatedEmailTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,9 @@ public function testSymfonySerialize()
7373
"html": null,
7474
"htmlCharset": null,
7575
"attachments": [
76-
{
77-
"body": "Some Text file",
78-
"name": "test.txt",
79-
"content-type": null,
80-
"inline": false
76+
{%A
77+
"body": "Some Text file",%A
78+
"name": "test.txt",%A
8179
}
8280
],
8381
"headers": {
@@ -111,11 +109,11 @@ public function testSymfonySerialize()
111109
], [new JsonEncoder()]);
112110

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

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

120118
$n->from('fabien@symfony.com');
121119
$expected->from('fabien@symfony.com');

src/Symfony/Component/Mime/Tests/MessageTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function testSymfonySerialize()
201201
"subtype": "plain",
202202
"disposition": null,
203203
"name": null,
204-
"encoding": "quoted-printable",
204+
"encoding": "quoted-printable",%A
205205
"headers": [],
206206
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\TextPart"
207207
},
@@ -211,7 +211,7 @@ public function testSymfonySerialize()
211211
"subtype": "html",
212212
"disposition": null,
213213
"name": null,
214-
"encoding": "quoted-printable",
214+
"encoding": "quoted-printable",%A
215215
"headers": [],
216216
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\TextPart"
217217
}
@@ -221,13 +221,13 @@ public function testSymfonySerialize()
221221
},
222222
{
223223
"filename": "text.txt",
224-
"mediaType": "application",
224+
"mediaType": "application",%A
225225
"body": "text data",
226226
"charset": null,
227227
"subtype": "octet-stream",
228228
"disposition": "attachment",
229229
"name": "text.txt",
230-
"encoding": "base64",
230+
"encoding": "base64",%A
231231
"headers": [],
232232
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\DataPart"
233233
}
@@ -249,12 +249,12 @@ public function testSymfonySerialize()
249249
], [new JsonEncoder()]);
250250

251251
$serialized = $serializer->serialize($e, 'json');
252-
$this->assertSame($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
252+
$this->assertStringMatchesFormat($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
253253

254254
$n = $serializer->deserialize($serialized, Message::class, 'json');
255255
$this->assertEquals($expected->getHeaders(), $n->getHeaders());
256256

257257
$serialized = $serializer->serialize($e, 'json');
258-
$this->assertSame($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
258+
$this->assertStringMatchesFormat($expectedJson, json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
259259
}
260260
}

src/Symfony/Component/Mime/composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
"symfony/dependency-injection": "^5.4|^6.0",
2727
"symfony/property-access": "^5.4|^6.0",
2828
"symfony/property-info": "^5.4|^6.0",
29-
"symfony/serializer": "^5.4.14|~6.0.14|^6.1.6"
29+
"symfony/serializer": "^5.2|^6.0"
3030
},
3131
"conflict": {
3232
"egulias/email-validator": "~3.0.0",
3333
"phpdocumentor/reflection-docblock": "<3.2.2",
3434
"phpdocumentor/type-resolver": "<1.4.0",
35-
"symfony/mailer": "<5.4",
36-
"symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6"
35+
"symfony/mailer": "<5.4"
3736
},
3837
"autoload": {
3938
"psr-4": { "Symfony\\Component\\Mime\\": "" },

0 commit comments

Comments
 (0)
0