Skip to content

Commit 9ffb5f0

Browse files
committed
Add test case.
1 parent 506b333 commit 9ffb5f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Component/HttpFoundation/Tests/Test/Constraint/ResponseFormatSameTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,14 @@ public function testNullFormat()
4747

4848
$constraint->evaluate(new Response('', 200, ['Content-Type' => 'application/ld+json']));
4949
}
50+
51+
public function testOverriddenFormat()
52+
{
53+
$request = new Request();
54+
// Request already defines 'application/vnd.api+json' as 'jsonapi'
55+
$request->setFormat('api_json', ['application/vnd.api+json']);
56+
57+
$constraint = new ResponseFormatSame($request, 'api_json');
58+
$this->assertTrue($constraint->evaluate(new Response('', 200, ['Content-Type' => 'application/vnd.api+json']), '', true));
59+
}
5060
}

0 commit comments

Comments
 (0)