Skip to content

Commit 044a0f0

Browse files
committed
minor #184 Fix orm tested version (ajgarlag)
This PR was squashed before being merged into the 0.4-dev branch. Discussion ---------- Fix orm tested version Test the bundle with the latest and lower supported ORM versions. Commits ------- 439eb27 Test on lowest dependencies 8017e2b Test on latest doctrine/orm versions
2 parents 4e59b1d + 439eb27 commit 044a0f0

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ jobs:
1616
matrix:
1717
php: ['8.1', '8.2', '8.3']
1818
symfony: ['5.4.*', '6.4.*', '7.0.*']
19-
doctrine-orm: ['2.14.*', '2.18.*', '3.0.*']
19+
doctrine-orm: ['^2.14', '^3.0']
2020
composer-flags: ['--prefer-stable']
2121
can-fail: [false]
22+
include:
23+
- php: "8.1"
24+
symfony: "5.4.*"
25+
doctrine-orm: "^2.14"
26+
composer-flags: '--prefer-stable --prefer-lowest'
27+
can-fail: false
2228
exclude:
2329
- php: "8.1"
2430
symfony: "7.0.*"
25-
- doctrine-orm: "2.14.*"
26-
symfony: "6.4.*"
27-
- doctrine-orm: "2.14.*"
28-
symfony: "7.0.*"
2931

3032
name: "PHP ${{ matrix.php }} - Doctrine ${{ matrix.doctrine-orm }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"
3133

@@ -40,7 +42,7 @@ jobs:
4042
run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} --build-arg XDEBUG_VERSION='3.3.1' php"
4143

4244
- name: "require specific Doctrine ORM version"
43-
run: "dev/bin/php composer require --ansi ${{ matrix.composer-flags }} doctrine/orm:${{ matrix.doctrine-orm }}"
45+
run: "dev/bin/php composer require --ansi ${{ matrix.composer-flags }} --no-install doctrine/orm:${{ matrix.doctrine-orm }}"
4446

4547
- name: "install dependencies"
4648
run: "dev/bin/php composer update --ansi ${{ matrix.composer-flags }}"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"doctrine/doctrine-bundle": "^2.0.8",
20+
"doctrine/doctrine-bundle": "^2.8.0",
2121
"doctrine/orm": "^2.14|^3.0",
2222
"league/oauth2-server": "^8.3",
2323
"nyholm/psr7": "^1.4",

tests/TestKernel.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace League\Bundle\OAuth2ServerBundle\Tests;
66

77
use Doctrine\DBAL\Platforms\SqlitePlatform;
8-
use Doctrine\ORM\Configuration as OrmConfiguration;
8+
use Doctrine\ORM\Mapping\Annotation;
99
use League\Bundle\OAuth2ServerBundle\Manager\AccessTokenManagerInterface;
1010
use League\Bundle\OAuth2ServerBundle\Manager\AuthorizationCodeManagerInterface;
1111
use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface;
@@ -80,9 +80,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
8080
],
8181
];
8282

83-
if (method_exists(OrmConfiguration::class, 'setLazyGhostObjectEnabled')) {
84-
$doctrine['orm'] = ['enable_lazy_ghost_objects' => true];
85-
}
83+
$doctrine['orm'] = ['enable_lazy_ghost_objects' => !interface_exists(Annotation::class)];
8684

8785
$container->loadFromExtension('doctrine', $doctrine);
8886

0 commit comments

Comments
 (0)