Skip to content

Commit a00c429

Browse files
committed
remove workarounds for symfony 5
1 parent af24cbb commit a00c429

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"symfony/phpunit-bridge": "^7.0.3"
2828
},
2929
"conflict": {
30+
"doctrine/phpcr-odm": "<2.0",
3031
"doctrine/phpcr-bundle": "<3.0",
31-
"symfony/framework-bundle": "<5.4.6"
32+
"symfony/framework-bundle": "<6.4"
3233
},
3334
"autoload": {
3435
"psr-4": {

resources/config/dist/security.php

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
],
4141
];
4242

43-
4443
if (class_exists(\Symfony\Component\Security\Core\Security::class)) {
4544
// Symfony 6 but not 7
4645
$config['enable_authenticator_manager'] = true;

src/Functional/BaseTestCase.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,7 @@ protected function getDbManager(string $type)
143143
));
144144
}
145145

146-
$refl = new \ReflectionClass($className);
147-
if (1 === $refl->getConstructor()->getNumberOfParameters()) {
148-
// phpcr-bundle < 3
149-
$dbManager = new $className(self::getContainer());
150-
} else {
151-
// phpcr-bundle >= 3
152-
$dbManager = new $className(self::getContainer()->get('doctrine_phpcr'), self::getContainer()->get('doctrine_phpcr.initializer_manager'));
153-
}
146+
$dbManager = new $className(self::getContainer());
154147

155148
$this->dbManagers[$type] = $dbManager;
156149

tests/Functional/BaseTestCaseTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use PHPUnit\Framework\TestCase;
1919
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
2020
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase;
21+
use Symfony\Cmf\Component\Testing\Functional\DbManager\PHPCR;
2122
use Symfony\Cmf\Component\Testing\Tests\Fixtures\TestTestCase;
2223
use Symfony\Component\DependencyInjection\Container;
2324
use Symfony\Component\HttpKernel\KernelInterface;
@@ -86,7 +87,6 @@ public function testGetKernel(): void
8687
{
8788
$class = new \ReflectionClass(BaseTestCase::class);
8889
$method = $class->getMethod('getKernel');
89-
$method->setAccessible(true);
9090

9191
$this->assertInstanceOf(KernelInterface::class, $method->invoke(null));
9292
}
@@ -95,7 +95,6 @@ public function testItCanProvideAFrameworkBundleClient(): void
9595
{
9696
$class = new \ReflectionClass(BaseTestCase::class);
9797
$method = $class->getMethod('getFrameworkBundleClient');
98-
$method->setAccessible(true);
9998

10099
$this->assertInstanceOf(KernelBrowser::class, $method->invoke($this->testCase));
101100
}
@@ -117,7 +116,6 @@ public function testDb($dbName, $expected)
117116
{
118117
$class = new \ReflectionClass(BaseTestCase::class);
119118
$method = $class->getMethod('getDbManager');
120-
$method->setAccessible(true);
121119

122120
if (null === $expected) {
123121
$this->expectException('InvalidArgumentException');

0 commit comments

Comments
 (0)