Skip to content

Commit b21959d

Browse files
committed
test(symfony): restore kernel to shutdown properly
1 parent 839fa24 commit b21959d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/Symfony/Bundle/Test/ApiTestCaseTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public function testAssertJsonContains(): void
7474
public function testAssertJsonContainsWithJsonObjectString(): void
7575
{
7676
self::createClient()->request('GET', '/');
77-
$this->assertJsonContains(<<<JSON
77+
$this->assertJsonContains(
78+
<<<JSON
7879
{
7980
"@context": "/contexts/Entrypoint"
8081
}
@@ -88,7 +89,8 @@ public function testAssertJsonContainsWithJsonScalarString(): void
8889
$this->expectExceptionMessage('$subset must be array or string (JSON array or JSON object)');
8990

9091
self::createClient()->request('GET', '/');
91-
$this->assertJsonContains(<<<JSON
92+
$this->assertJsonContains(
93+
<<<JSON
9294
"/contexts/Entrypoint"
9395
JSON
9496
);
@@ -109,7 +111,8 @@ public function testAssertJsonEquals(): void
109111
public function testAssertJsonEqualsWithJsonObjectString(): void
110112
{
111113
self::createClient()->request('GET', '/contexts/Address');
112-
$this->assertJsonEquals(<<<JSON
114+
$this->assertJsonEquals(
115+
<<<JSON
113116
{
114117
"@context": {
115118
"@vocab": "http://localhost/docs.jsonld#",
@@ -403,8 +406,12 @@ public function testDoNotRebootKernelOnCreateClient(): void
403406
$mock->method('getContainer')->willReturn(self::getContainer());
404407
$mock->expects($this->never())->method('boot');
405408

409+
$oldKernel = self::$kernel;
406410
self::$kernel = $mock;
407411

408412
self::createClient();
413+
414+
// restore old kernel for proper shutdown
415+
self::$kernel = $oldKernel;
409416
}
410417
}

0 commit comments

Comments
 (0)