Skip to content

Commit 688a6ff

Browse files
committed
test: fix php unit test
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
1 parent 94e91e4 commit 688a6ff

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/lib/Controller/OpenProjectAPIControllerTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,14 @@ public function testGetOpenProjectAvatar(string $authorizationMethod) {
230230
]);
231231
$response = $controller->getOpenProjectAvatar('id', 'name');
232232
$this->assertSame('some image data', $response->render());
233-
$this->assertSame(
234-
"attachment; filename=\"avatar\"",
233+
$this->assertMatchesRegularExpression(
234+
'/attachment; filename="?avatar"?/',
235235
$response->getHeaders()["Content-Disposition"]
236236
);
237+
// $this->assertSame(
238+
// "attachment; filename=avatar",
239+
// $response->getHeaders()["Content-Disposition"]
240+
// );
237241
$this->assertSame(
238242
"image/png",
239243
$response->getHeaders()["Content-Type"]
@@ -267,8 +271,8 @@ public function testGetOpenProjectAvatarNoType(string $authorizationMethod) {
267271
]);
268272
$response = $controller->getOpenProjectAvatar('id', 'name');
269273
$this->assertSame('some image data', $response->render());
270-
$this->assertSame(
271-
"attachment; filename=\"avatar\"",
274+
$this->assertMatchesRegularExpression(
275+
'/attachment; filename="?avatar"?/',
272276
$response->getHeaders()["Content-Disposition"]
273277
);
274278
$this->assertEmpty($response->getHeaders()["Content-Type"]);

0 commit comments

Comments
 (0)