Skip to content

Commit 4e6c3f4

Browse files
Merge branch '6.3' into 6.4
* 6.3: Run tests with ORM 3 and DBAL 4
2 parents 10d1fa4 + 999ede2 commit 4e6c3f4

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

Tests/Caster/DoctrineCasterTest.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,28 @@ public function testCastPersistentCollection()
3131

3232
$collection = new PersistentCollection($this->createMock(EntityManagerInterface::class), $classMetadata, new ArrayCollection(['test']));
3333

34-
$expected = <<<EODUMP
35-
Doctrine\ORM\PersistentCollection {
36-
%A
37-
-em: Mock_EntityManagerInterface_%s { …3}
38-
-backRefFieldName: null
39-
-typeClass: Doctrine\ORM\Mapping\ClassMetadata { …}
40-
%A
41-
EODUMP;
34+
if (property_exists(PersistentCollection::class, 'isDirty')) {
35+
// Collections >= 2
36+
$expected = <<<EODUMP
37+
Doctrine\ORM\PersistentCollection {
38+
%A
39+
-em: Mock_EntityManagerInterface_%s { …3}
40+
-backRefFieldName: null
41+
-isDirty: false
42+
-typeClass: Doctrine\ORM\Mapping\ClassMetadata { …}
43+
%A
44+
EODUMP;
45+
} else {
46+
// Collections 1
47+
$expected = <<<EODUMP
48+
Doctrine\ORM\PersistentCollection {
49+
%A
50+
-em: Mock_EntityManagerInterface_%s { …3}
51+
-backRefFieldName: null
52+
-typeClass: Doctrine\ORM\Mapping\ClassMetadata { …}
53+
%A
54+
EODUMP;
55+
}
4256

4357
$this->assertDumpMatchesFormat($expected, $collection);
4458
}

0 commit comments

Comments
 (0)