Skip to content

Commit cbfee82

Browse files
committed
tests: skip test when using an old version of HttpFoundation
1 parent 6ef1ed1 commit cbfee82

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Test/WebTestCaseTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Symfony\Component\HttpFoundation\Cookie as HttpFoundationCookie;
2424
use Symfony\Component\HttpFoundation\Request;
2525
use Symfony\Component\HttpFoundation\Response;
26+
use Symfony\Component\HttpFoundation\Test\Constraint\ResponseFormatSame;
2627

2728
class WebTestCaseTest extends TestCase
2829
{
@@ -77,6 +78,10 @@ public function testAssertResponseRedirectsWithLocationAndStatusCode()
7778

7879
public function testAssertResponseFormat()
7980
{
81+
if (!class_exists(ResponseFormatSame::class)) {
82+
$this->markTestSkipped('Too old version of HttpFoundation.');
83+
}
84+
8085
$this->getResponseTester(new Response('', 200, ['Content-Type' => 'application/vnd.myformat']))->assertResponseFormatSame('custom');
8186
$this->getResponseTester(new Response('', 200, ['Content-Type' => 'application/ld+json']))->assertResponseFormatSame('jsonld');
8287
$this->expectException(AssertionFailedError::class);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy