diff --git a/Test/AbstractElasticsearchTestCase.php b/Test/AbstractElasticsearchTestCase.php index 9d5a2ef1..f3d7d28b 100644 --- a/Test/AbstractElasticsearchTestCase.php +++ b/Test/AbstractElasticsearchTestCase.php @@ -13,7 +13,6 @@ use ONGR\ElasticsearchBundle\Service\Manager; use ONGR\ElasticsearchBundle\Tests\WebTestCase; -use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -170,7 +169,7 @@ protected function doTearDown() * * @return ContainerInterface */ - protected static function getContainer(): Container + protected static function getKernelContainer(): ContainerInterface { if (null === self::$container) { self::bootKernel(); @@ -198,9 +197,9 @@ protected function getManager($name = 'default') $this->ignoreVersions($this->managers[$name]); return $this->managers[$name]; - } elseif ($this->getContainer()->has($serviceName)) { + } elseif ($this->getKernelContainer()->has($serviceName)) { /** @var Manager $manager */ - $manager = $this->getContainer()->get($serviceName); + $manager = $this->getKernelContainer()->get($serviceName); $this->managers[$name] = $manager; } else { throw new \LogicException(sprintf("Manager '%s' does not exist", $name)); diff --git a/Tests/Functional/Command/CreateIndexCommandTest.php b/Tests/Functional/Command/CreateIndexCommandTest.php index 4ed7e8e4..d37aada0 100644 --- a/Tests/Functional/Command/CreateIndexCommandTest.php +++ b/Tests/Functional/Command/CreateIndexCommandTest.php @@ -186,7 +186,7 @@ public function testIndexMappingDump() private function getCommandTester() { $indexCreateCommand = new IndexCreateCommand( - $this->getContainer()->get('es.client.index_suffix_finder'), + $this->getKernelContainer()->get('es.client.index_suffix_finder'), ['es.manager.default' => $this->getManager()] ); diff --git a/Tests/Functional/Command/IndexExportCommandTest.php b/Tests/Functional/Command/IndexExportCommandTest.php index 3513127b..29df04b1 100644 --- a/Tests/Functional/Command/IndexExportCommandTest.php +++ b/Tests/Functional/Command/IndexExportCommandTest.php @@ -163,7 +163,7 @@ public function testIndexExport($options, $expectedResults) private function getCommandTester() { $indexExportCommand = new IndexExportCommand( - $this->getContainer()->get('es.export'), + $this->getKernelContainer()->get('es.export'), ['es.manager.default' => $this->getManager()] ); diff --git a/Tests/Functional/Command/IndexImportCommandTest.php b/Tests/Functional/Command/IndexImportCommandTest.php index 6822e19d..40eba3ed 100644 --- a/Tests/Functional/Command/IndexImportCommandTest.php +++ b/Tests/Functional/Command/IndexImportCommandTest.php @@ -143,7 +143,7 @@ public function testIndexImportWithGzipOption($bulkSize, $realSize, $filename) private function getImportCommand() { return new IndexImportCommand( - $this->getContainer()->get('es.import'), + $this->getKernelContainer()->get('es.import'), ['es.manager.default' => $this->getManager()] ); } diff --git a/Tests/Functional/Mapping/DocumentFinderTest.php b/Tests/Functional/Mapping/DocumentFinderTest.php index f53b3631..d5b71b55 100644 --- a/Tests/Functional/Mapping/DocumentFinderTest.php +++ b/Tests/Functional/Mapping/DocumentFinderTest.php @@ -23,7 +23,7 @@ class DocumentFinderTest extends WebTestCase */ public function testGetBundleDocumentClasses() { - $finder = new DocumentFinder($this->getContainer()->getParameter('kernel.bundles')); + $finder = new DocumentFinder($this->getClientContainer()->getParameter('kernel.bundles')); $this->assertGreaterThan(0, count($finder->getBundleDocumentClasses('TestBundle'))); $this->assertEquals(0, count($finder->getBundleDocumentClasses('FrameworkBundle'))); } @@ -36,7 +36,7 @@ public function testGetBundleClassException() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Bundle \'NotExistingBundle\' does not exist.'); - $finder = new DocumentFinder($this->getContainer()->getParameter('kernel.bundles')); + $finder = new DocumentFinder($this->getClientContainer()->getParameter('kernel.bundles')); $finder->getBundleClass('NotExistingBundle'); } @@ -45,7 +45,7 @@ public function testGetBundleClassException() * * @return ContainerInterface */ - protected static function getContainer(): Container + protected static function getClientContainer(): ContainerInterface { return static::createClient()->getContainer(); } diff --git a/Tests/Functional/Profiler/ElasticsearchProfilerTest.php b/Tests/Functional/Profiler/ElasticsearchProfilerTest.php index a2fcefab..0d9c786f 100644 --- a/Tests/Functional/Profiler/ElasticsearchProfilerTest.php +++ b/Tests/Functional/Profiler/ElasticsearchProfilerTest.php @@ -172,7 +172,7 @@ public function checkQueryParameters(&$query) */ private function getCollector() { - $collector = $this->getContainer()->get('es.profiler'); + $collector = $this->getKernelContainer()->get('es.profiler'); $collector->collect(new Request(), new Response()); return $collector; diff --git a/composer.json b/composer.json index f81f1463..c4ced674 100644 --- a/composer.json +++ b/composer.json @@ -53,5 +53,12 @@ "replace": { "ongr/elasticsearch-bundle": "self.version" }, - "minimum-stability": "dev" + "minimum-stability": "dev", + "extra": { + "symfony": { + "recipe-contrib": false, + "allow-contrib": false, + "require": "7.1.*" + } + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3c612269..a4001ad9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -24,7 +24,7 @@ - +