Skip to content

Commit

Permalink
minor #184 Fix orm tested version (ajgarlag)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chalasr committed Mar 17, 2024
2 parents 4e59b1d + 439eb27 commit 044a0f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ 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]
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.*"
- 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) || '' }}"

Expand All @@ -40,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 }}"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 044a0f0

Please sign in to comment.