File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,28 @@ public function testCastPersistentCollection()
31
31
32
32
$ collection = new PersistentCollection ($ this ->createMock (EntityManagerInterface::class), $ classMetadata , new ArrayCollection (['test ' ]));
33
33
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
+ }
42
56
43
57
$ this ->assertDumpMatchesFormat ($ expected , $ collection );
44
58
}
You can’t perform that action at this time.
0 commit comments