From 8017e2b612801c71dd3ff910fc25cc9aed3c6ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20J=2E=20Garc=C3=ADa=20Lagar?= Date: Tue, 12 Mar 2024 11:11:01 +0100 Subject: [PATCH 1/2] Test on latest doctrine/orm versions --- .github/workflows/unit-tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 96b16f8..ea07876 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -16,16 +16,12 @@ jobs: matrix: php: ['8.1', '8.2', '8.3'] symfony: ['5.4.*', '6.4.*', '7.0.*'] - doctrine-orm: ['2.14.*', '2.18.*', '3.0.*'] + doctrine-orm: ['^2.14', '^3.0'] composer-flags: ['--prefer-stable'] can-fail: [false] exclude: - php: "8.1" symfony: "7.0.*" - - doctrine-orm: "2.14.*" - symfony: "6.4.*" - - doctrine-orm: "2.14.*" - symfony: "7.0.*" name: "PHP ${{ matrix.php }} - Doctrine ${{ matrix.doctrine-orm }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}" From 439eb27c6e095039177c767dbdb0329cd9036294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20J=2E=20Garc=C3=ADa=20Lagar?= Date: Tue, 12 Mar 2024 11:19:19 +0100 Subject: [PATCH 2/2] Test on lowest dependencies --- .github/workflows/unit-tests.yml | 8 +++++++- composer.json | 2 +- tests/TestKernel.php | 6 ++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ea07876..52e4512 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -19,6 +19,12 @@ jobs: doctrine-orm: ['^2.14', '^3.0'] composer-flags: ['--prefer-stable'] 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.*" @@ -36,7 +42,7 @@ jobs: run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} --build-arg XDEBUG_VERSION='3.3.1' 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 ${{ matrix.composer-flags }} --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);