Skip to content

Commit 27e3596

Browse files
committed
github actions
1 parent 3b26acc commit 27e3596

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

tests/Integration/IntegrationTest.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,29 @@
99

1010
class IntegrationTest extends KernelTestCase
1111
{
12-
public function testServiceWiring()
12+
private static function getInspectorService(): Inspector
1313
{
1414
self::bootKernel(['environment' => 'test']);
1515

16-
$inspectorService = static::getContainer()->get(Inspector::class);
16+
// static::getContainer() was added in Symfony 5.3; fall back to
17+
// the deprecated self::$container for older versions.
18+
if (method_exists(static::class, 'getContainer')) {
19+
return static::getContainer()->get(Inspector::class);
20+
}
21+
22+
return self::$container->get(Inspector::class);
23+
}
24+
25+
public function testServiceWiring()
26+
{
27+
$inspectorService = self::getInspectorService();
1728

1829
$this->assertInstanceOf(Inspector::class, $inspectorService);
1930
}
2031

2132
public function testServiceWiringWithConfiguration()
2233
{
23-
self::bootKernel(['environment' => 'test']);
24-
25-
$inspectorService = static::getContainer()->get(Inspector::class);
34+
$inspectorService = self::getInspectorService();
2635

2736
$this->assertFalse($inspectorService->hasTransaction());
2837
}

0 commit comments

Comments
 (0)