Skip to content

Commit d94fbbf

Browse files
authored
Merge pull request #2879 from dunglas/flaky-test
Fix flaky test
2 parents 2ca416b + db0ea23 commit d94fbbf

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/Action/ExceptionActionTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ public function testActionWithCatchableException()
4646
$request = new Request();
4747
$request->setFormat('jsonproblem', 'application/problem+json');
4848

49-
$expected = new Response('', Response::HTTP_BAD_REQUEST, [
50-
'Content-Type' => 'application/problem+json; charset=utf-8',
51-
'X-Content-Type-Options' => 'nosniff',
52-
'X-Frame-Options' => 'deny',
53-
]);
54-
55-
$this->assertEquals($expected, $exceptionAction($flattenException, $request));
49+
$response = $exceptionAction($flattenException, $request);
50+
$this->assertSame('', $response->getContent());
51+
$this->assertSame(Response::HTTP_BAD_REQUEST, $response->getStatusCode());
52+
$this->assertTrue($response->headers->contains('Content-Type', 'application/problem+json; charset=utf-8'));
53+
$this->assertTrue($response->headers->contains('X-Content-Type-Options', 'nosniff'));
54+
$this->assertTrue($response->headers->contains('X-Frame-Options', 'deny'));
5655
}
5756

5857
public function testActionWithUncatchableException()

0 commit comments

Comments
 (0)