From d82376fda3f7183b9a65504f5802e133d0eb0d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chru=C5=9Bciel?= Date: Mon, 29 Jul 2024 14:08:18 +0200 Subject: [PATCH] [Maintenance] Add support for doctrine/orm 3.0 --- .github/workflows/build.yml | 7 ++++++- composer.json | 2 +- src/ApiTestCase.php | 3 --- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7bcd5a6..338c6cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: "ubuntu-latest" - name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PHPUnit ${{ matrix.phpunit }}, PHP-Matcher ${{ matrix.php-matcher }}" + name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PHPUnit ${{ matrix.phpunit }}, PHP-Matcher ${{ matrix.php-matcher }}, Doctrine ORM ${{ matrix.orm }}" strategy: fail-fast: false @@ -24,6 +24,7 @@ jobs: symfony: [6.4.*, 7.0.*] phpunit: [^9.0, ^10.0, ^11.0] php-matcher: [^6.0] + orm: [^2.5, ^3.0] exclude: - php: 8.1 symfony: 7.0.* @@ -51,6 +52,10 @@ jobs: name: "Restrict coduo/php-matcher version" run: "composer require \"coduo/php-matcher:${{ matrix.php-matcher }}\" --no-update --no-scripts" + - + name: "Restrict doctrine/orm version" + run: "composer require \"doctrine/orm:${{ matrix.orm }}\" --no-update --no-scripts" + - name: "Restrict phpunit/phpunit version" run: "composer require \"phpunit/phpunit:${{ matrix.phpunit }}\" --no-update --no-scripts" diff --git a/composer.json b/composer.json index b8fce6d..eee4e8d 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "openlss/lib-array2xml": "^1.0", "doctrine/data-fixtures": "^1.2", "doctrine/doctrine-bundle": "^2.0", - "doctrine/orm": "^2.5", + "doctrine/orm": "^2.5 || ^3.0", "nelmio/alice": "^3.6", "phpspec/php-diff": "^1.1", "phpunit/phpunit": "^9.0 || ^10.0 || ^11.0", diff --git a/src/ApiTestCase.php b/src/ApiTestCase.php index 6c2d3bb..e1f23a9 100644 --- a/src/ApiTestCase.php +++ b/src/ApiTestCase.php @@ -102,9 +102,6 @@ public function setUpDatabase(): void $entityManager = $container->get('doctrine.orm.entity_manager'); Assert::notNull($entityManager); - $this->entityManager = $entityManager; - $this->entityManager->getConnection()->connect(); - /** @var LoaderInterface $fixtureLoader */ $fixtureLoader = $container->get('fidry_alice_data_fixtures.loader.doctrine'); $this->fixtureLoader = $fixtureLoader;