From a00c429fbccc41e8070ae6228f5164b96fda2294 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 6 Apr 2024 10:17:32 +0200 Subject: [PATCH] remove workarounds for symfony 5 --- composer.json | 3 ++- resources/config/dist/security.php | 1 - src/Functional/BaseTestCase.php | 9 +-------- tests/Functional/BaseTestCaseTest.php | 4 +--- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 7321256..12d8681 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,9 @@ "symfony/phpunit-bridge": "^7.0.3" }, "conflict": { + "doctrine/phpcr-odm": "<2.0", "doctrine/phpcr-bundle": "<3.0", - "symfony/framework-bundle": "<5.4.6" + "symfony/framework-bundle": "<6.4" }, "autoload": { "psr-4": { diff --git a/resources/config/dist/security.php b/resources/config/dist/security.php index 3008522..57d1dc1 100644 --- a/resources/config/dist/security.php +++ b/resources/config/dist/security.php @@ -40,7 +40,6 @@ ], ]; - if (class_exists(\Symfony\Component\Security\Core\Security::class)) { // Symfony 6 but not 7 $config['enable_authenticator_manager'] = true; diff --git a/src/Functional/BaseTestCase.php b/src/Functional/BaseTestCase.php index 9d7b66e..022559e 100644 --- a/src/Functional/BaseTestCase.php +++ b/src/Functional/BaseTestCase.php @@ -143,14 +143,7 @@ protected function getDbManager(string $type) )); } - $refl = new \ReflectionClass($className); - if (1 === $refl->getConstructor()->getNumberOfParameters()) { - // phpcr-bundle < 3 - $dbManager = new $className(self::getContainer()); - } else { - // phpcr-bundle >= 3 - $dbManager = new $className(self::getContainer()->get('doctrine_phpcr'), self::getContainer()->get('doctrine_phpcr.initializer_manager')); - } + $dbManager = new $className(self::getContainer()); $this->dbManagers[$type] = $dbManager; diff --git a/tests/Functional/BaseTestCaseTest.php b/tests/Functional/BaseTestCaseTest.php index f441da7..34ad8c3 100644 --- a/tests/Functional/BaseTestCaseTest.php +++ b/tests/Functional/BaseTestCaseTest.php @@ -18,6 +18,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Cmf\Component\Testing\Functional\BaseTestCase; +use Symfony\Cmf\Component\Testing\Functional\DbManager\PHPCR; use Symfony\Cmf\Component\Testing\Tests\Fixtures\TestTestCase; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpKernel\KernelInterface; @@ -86,7 +87,6 @@ public function testGetKernel(): void { $class = new \ReflectionClass(BaseTestCase::class); $method = $class->getMethod('getKernel'); - $method->setAccessible(true); $this->assertInstanceOf(KernelInterface::class, $method->invoke(null)); } @@ -95,7 +95,6 @@ public function testItCanProvideAFrameworkBundleClient(): void { $class = new \ReflectionClass(BaseTestCase::class); $method = $class->getMethod('getFrameworkBundleClient'); - $method->setAccessible(true); $this->assertInstanceOf(KernelBrowser::class, $method->invoke($this->testCase)); } @@ -117,7 +116,6 @@ public function testDb($dbName, $expected) { $class = new \ReflectionClass(BaseTestCase::class); $method = $class->getMethod('getDbManager'); - $method->setAccessible(true); if (null === $expected) { $this->expectException('InvalidArgumentException');