From e52261a58e81ad840daa687276e00a248db5ac3c Mon Sep 17 00:00:00 2001 From: Vincent Chalamon <407859+vincentchalamon@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:40:51 +0100 Subject: [PATCH] chore: support doctrine/orm 3.0 and doctrine/data-fixtures 2.0 --- composer.json | 4 ++-- tests/Manager/Bridge/DoctrineManagerTest.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 331c650..ccee591 100644 --- a/composer.json +++ b/composer.json @@ -29,9 +29,9 @@ "api-platform/core": "^3.0 || ^4.0", "behat/behat": "^3.1", "dg/bypass-finals": "^1.1", - "doctrine/data-fixtures": "^1.2", + "doctrine/data-fixtures": "^1.2 || ^2.0", "doctrine/doctrine-bundle": "^2.11", - "doctrine/orm": "^2.6.3", + "doctrine/orm": "^2.6.3 || ^3.0", "friends-of-behat/symfony-extension": "^2.0.11 || ^2.1.0", "jms/serializer-bundle": "^1.4 || ^2.3 || ^3.0 || ^4.0 || ^5.0", "laminas/laminas-code": "^3.4 || ^4.0", diff --git a/tests/Manager/Bridge/DoctrineManagerTest.php b/tests/Manager/Bridge/DoctrineManagerTest.php index ef9aea7..bb76c33 100755 --- a/tests/Manager/Bridge/DoctrineManagerTest.php +++ b/tests/Manager/Bridge/DoctrineManagerTest.php @@ -45,11 +45,12 @@ protected function setUp(): void public function testFindOneBy(): void { + $expected = new \stdClass(); $this->registryMock->expects($this->once())->method('getManagerForClass')->with('class')->willReturn($this->managerMock); $this->managerMock->expects($this->once())->method('getRepository')->with('class')->willReturn($this->repositoryMock); - $this->repositoryMock->expects($this->once())->method('findOneBy')->with(['criteria'])->willReturn('foo'); + $this->repositoryMock->expects($this->once())->method('findOneBy')->with(['criteria'])->willReturn($expected); - $this->assertEquals('foo', $this->doctrineManager->findOneBy('class', ['criteria'])); + $this->assertEquals($expected, $this->doctrineManager->findOneBy('class', ['criteria'])); } public function testPersist(): void