You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Rules/Doctrine/ORM/EntityRelationRuleTest.php
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,44 @@ public function ruleProvider(): Iterator
66
66
50,
67
67
]
68
68
]];
69
+
70
+
yield'one to many' => [__DIR__ . '/data/EntityWithBrokenOneToManyRelations.php', [
71
+
[
72
+
'Property can contain iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity> but database expects Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
73
+
24,
74
+
],
75
+
[
76
+
'Property can contain Doctrine\Common\Collections\Collection but database expects Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
77
+
30,
78
+
],
79
+
[
80
+
'Database can contain Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity> but property expects array<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
81
+
36,
82
+
],
83
+
[
84
+
'Property can contain array<PHPStan\Rules\Doctrine\ORM\AnotherEntity> but database expects Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
85
+
36,
86
+
]
87
+
]];
88
+
89
+
yield'many to many' => [__DIR__ . '/data/EntityWithBrokenManyToManyRelations.php', [
90
+
[
91
+
'Property can contain iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity> but database expects Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
92
+
24,
93
+
],
94
+
[
95
+
'Property can contain Doctrine\Common\Collections\Collection but database expects Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
96
+
30,
97
+
],
98
+
[
99
+
'Database can contain Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity> but property expects array<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
100
+
36,
101
+
],
102
+
[
103
+
'Property can contain array<PHPStan\Rules\Doctrine\ORM\AnotherEntity> but database expects Doctrine\Common\Collections\Collection&iterable<PHPStan\Rules\Doctrine\ORM\AnotherEntity>.',
0 commit comments