diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ea07876..a72f7ba 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -18,7 +18,14 @@ jobs: symfony: ['5.4.*', '6.4.*', '7.0.*'] doctrine-orm: ['^2.14', '^3.0'] composer-flags: ['--prefer-stable'] + xdebug: ['3.3.1'] can-fail: [false] + include: + - php: "8.1" + symfony: "5.4.*" + doctrine-orm: "^2.14" + composer-flags: '--prefer-stable --prefer-lowest' + can-fail: false exclude: - php: "8.1" symfony: "7.0.*" @@ -33,10 +40,10 @@ jobs: uses: "actions/checkout@v4" - name: "build the PHP environment" - run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} --build-arg XDEBUG_VERSION='3.3.1' php" + run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} --build-arg XDEBUG_VERSION=${{ matrix.xdebug }} php" - name: "require specific Doctrine ORM version" - run: "dev/bin/php composer require --ansi ${{ matrix.composer-flags }} doctrine/orm:${{ matrix.doctrine-orm }}" + run: "dev/bin/php composer require --ansi --no-install doctrine/orm:${{ matrix.doctrine-orm }}" - name: "install dependencies" run: "dev/bin/php composer update --ansi ${{ matrix.composer-flags }}" diff --git a/composer.json b/composer.json index 5c806fc..f160c80 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^8.1", - "doctrine/doctrine-bundle": "^2.0.8", + "doctrine/doctrine-bundle": "^2.8.0", "doctrine/orm": "^2.14|^3.0", "league/oauth2-server": "^8.3", "nyholm/psr7": "^1.4", diff --git a/tests/TestKernel.php b/tests/TestKernel.php index 2fc8e22..dbd560c 100644 --- a/tests/TestKernel.php +++ b/tests/TestKernel.php @@ -5,7 +5,7 @@ namespace League\Bundle\OAuth2ServerBundle\Tests; use Doctrine\DBAL\Platforms\SqlitePlatform; -use Doctrine\ORM\Configuration as OrmConfiguration; +use Doctrine\ORM\Mapping\Annotation; use League\Bundle\OAuth2ServerBundle\Manager\AccessTokenManagerInterface; use League\Bundle\OAuth2ServerBundle\Manager\AuthorizationCodeManagerInterface; use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface; @@ -80,9 +80,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void ], ]; - if (method_exists(OrmConfiguration::class, 'setLazyGhostObjectEnabled')) { - $doctrine['orm'] = ['enable_lazy_ghost_objects' => true]; - } + $doctrine['orm'] = ['enable_lazy_ghost_objects' => !interface_exists(Annotation::class)]; $container->loadFromExtension('doctrine', $doctrine);