Skip to content

Commit 999ede2

Browse files
committed
Run tests with ORM 3 and DBAL 4
This reverts commit 913a317706780c843a7d1d7ed78e2e81a0d4d9e1.
1 parent 3d99993 commit 999ede2

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)