Skip to content

Commit

Permalink
remove workarounds for symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Apr 6, 2024
1 parent af24cbb commit a00c429
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion resources/config/dist/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
],
];


if (class_exists(\Symfony\Component\Security\Core\Security::class)) {
// Symfony 6 but not 7
$config['enable_authenticator_manager'] = true;
Expand Down
9 changes: 1 addition & 8 deletions src/Functional/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions tests/Functional/BaseTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand All @@ -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));
}
Expand All @@ -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');
Expand Down

0 comments on commit a00c429

Please sign in to comment.