Skip to content

Commit 34c9f8b

Browse files
Allow doctrine orm 3 (#13)
1 parent caff067 commit 34c9f8b

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
with:
5454
php-version: 8.3
5555
coverage: none
56-
tools: vimeo/psalm:4.8.1
56+
tools: vimeo/psalm:5.24.0
5757

5858
- name: Download dependencies
5959
uses: ramsey/composer-install@v1

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"require": {
1717
"php": "^8.1",
18-
"doctrine/orm": "^2.4",
18+
"doctrine/orm": "^2.4 || ^3.0",
1919
"symfony/validator": "^6.0 || ^7.0"
2020
},
2121
"require-dev": {

tests/EntityExistValidatorTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testValidateValidEntity(): void
6464
->expects($this->once())
6565
->method('findOneBy')
6666
->with(['id' => 'foobar'])
67-
->willReturn('my_user');
67+
->willReturn(new UserDummy());
6868

6969
$this->entityManager
7070
->expects($this->once())
@@ -92,7 +92,7 @@ public function testValidateSkipsIfValueEmptyOrNull($value): void
9292
->expects($this->exactly(0))
9393
->method('findOneBy')
9494
->with(['id' => $value])
95-
->willReturn('my_user');
95+
->willReturn(new UserDummy());
9696

9797
$this->entityManager
9898
->expects($this->exactly(0))
@@ -124,7 +124,7 @@ public function testValidateValidEntityWithCustomProperty(): void
124124
->expects($this->once())
125125
->method('findOneBy')
126126
->with(['uuid' => 'foobar'])
127-
->willReturn('my_user');
127+
->willReturn(new UserDummy());
128128

129129
$this->entityManager
130130
->expects($this->once())
@@ -181,7 +181,7 @@ public function testValidateFromAttribute()
181181
->expects($this->once())
182182
->method('findOneBy')
183183
->with(['uuid' => 'foobar'])
184-
->willReturn('my_user');
184+
->willReturn(new UserDummy());
185185

186186
$this->entityManager
187187
->expects($this->once())
@@ -193,6 +193,10 @@ public function testValidateFromAttribute()
193193
}
194194
}
195195

196+
class UserDummy
197+
{
198+
}
199+
196200
class EntityDummy
197201
{
198202
#[EntityExist(entity: 'App\Entity\User', property: 'uuid')]

0 commit comments

Comments
 (0)