diff --git a/composer.json b/composer.json index aa356c8..6969656 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,11 @@ "nette/tester": "~1.7 | ~2.0", "nette/utils": "~2.3", "nextras/dbal": "~1.0 | ~2.0 | ~3.0 | ~4.0 | ~5.0@dev", - "symfony/config": "~2.6 | ~3.0 | ~4.0", - "symfony/console": "~2.6 | ~3.0 | ~4.0", - "symfony/dependency-injection": "~2.6 | ~3.0 | ~4.0", - "symfony/http-kernel": "~2.6 | ~3.0 | ~4.0", + "symfony/config": "~2.6 | ~3.0 | ~4.0 | ~5.0 | ~6.0", + "symfony/console": "~2.6 | ~3.0 | ~4.0 | ~5.0 | ~6.0", + "symfony/dependency-injection": "~2.6 | ~3.0 | ~4.0 | ~5.0 | ~6.0", + "symfony/framework-bundle": "~2.6 | ~3.0 | ~4.0 | ~5.0 | ~6.0", + "symfony/http-kernel": "~2.6 | ~3.0 | ~4.0 | ~5.0 | ~6.0", "tracy/tracy": "^2.2", "ext-openssl": "*" }, diff --git a/tests/cases/integration/symfony-bundle/SymfonyBundleTest.phpt b/tests/cases/integration/symfony-bundle/SymfonyBundleTest.phpt index 8781cf7..47b0ff2 100644 --- a/tests/cases/integration/symfony-bundle/SymfonyBundleTest.phpt +++ b/tests/cases/integration/symfony-bundle/SymfonyBundleTest.phpt @@ -35,7 +35,8 @@ class SymfonyBundleTest extends TestCase $dbalOptions = $driversConfig[$options['driver']]; $doctrineDriver = $options['driver'] === 'mysql' ? 'pdo_mysql' : 'pdo_pgsql'; - $this->symfonyKernel = new TestSymfonyKernel(__DIR__ . '/SymfonyBundleTest.yaml', [ + $className = PHP_VERSION_ID >= 70100 ? 'NextrasTests\Migrations\TestSymfonyKernel6' : 'NextrasTests\Migrations\TestSymfonyKernel'; + $this->symfonyKernel = new $className(__DIR__ . '/SymfonyBundleTest.yaml', [ 'doctrine_dbal_driver' => $doctrineDriver, 'doctrine_dbal_host' => $dbalOptions['host'], 'doctrine_dbal_database' => $dbalOptions['database'], diff --git a/tests/inc/TestSymfonyKernel6.php b/tests/inc/TestSymfonyKernel6.php new file mode 100644 index 0000000..8152e0e --- /dev/null +++ b/tests/inc/TestSymfonyKernel6.php @@ -0,0 +1,63 @@ +configPath = $configPath; + $this->parameters = $parameters; + } + + + public function getRootDir() + { + return TEMP_DIR . '/symfony-bundle'; + } + + + public function registerBundles(): iterable + { + return [ + new FrameworkBundle(), + new DoctrineBundle(), + new NextrasMigrationsBundle(), + ]; + } + + + public function registerContainerConfiguration(LoaderInterface $loader) + { + $loader->load(function (ContainerBuilder $container) { + $container->addResource(new ContainerParametersResource($this->parameters)); + foreach ($this->parameters as $key => $value) { + $container->setParameter($key, $value); + } + }); + + $loader->load($this->configPath); + } +} diff --git a/tests/matrix/symfony-bundle/symfony-6.0-php-8.0.sh b/tests/matrix/symfony-bundle/symfony-6.0-php-8.0.sh new file mode 100644 index 0000000..c5403fa --- /dev/null +++ b/tests/matrix/symfony-bundle/symfony-6.0-php-8.0.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +PHP_VERSION_MIN="80000" +PHP_VERSION_MAX="80199" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/dbal:~3.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/orm:~2.11" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/doctrine-bundle:~2.6" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/config:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/console:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/dependency-injection:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/doctrine-bridge:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/framework-bundle:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/http-kernel:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/yaml:~6.0" +COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/tester:~2.3" +DBAL='doctrine'