18
18
use function assert ;
19
19
use function interface_exists ;
20
20
21
+ use const PHP_VERSION_ID ;
22
+
21
23
class RegistryTest extends TestCase
22
24
{
23
25
public function testGetDefaultConnectionName (): void
@@ -116,7 +118,10 @@ public function testResetUnknownEntityManager(): void
116
118
$ registry ->resetManager ('default ' );
117
119
}
118
120
119
- /** @group legacy */
121
+ /**
122
+ * @group legacy
123
+ * @requires PHP < 8.4
124
+ */
120
125
public function testReset (): void
121
126
{
122
127
if (! interface_exists (EntityManagerInterface::class)) {
@@ -146,6 +151,7 @@ public function testReset(): void
146
151
$ registry ->reset ();
147
152
}
148
153
154
+ /** @requires PHP < 8.4 */
149
155
public function testResetLazyObject (): void
150
156
{
151
157
if (! interface_exists (EntityManagerInterface::class) || ! interface_exists (LazyObjectInterface::class)) {
@@ -166,6 +172,11 @@ public function testResetLazyObject(): void
166
172
(new Registry ($ container , [], $ entityManagers , 'default ' , 'default ' ))->reset ();
167
173
}
168
174
175
+ /**
176
+ * The legacy group should be removed after https://github.com/doctrine/orm/pull/11853 is merged
177
+ *
178
+ * @group legacy
179
+ */
169
180
public function testIdentityMapsStayConsistentAfterReset (): void
170
181
{
171
182
if (! interface_exists (EntityManagerInterface::class)) {
@@ -178,11 +189,15 @@ public function testIdentityMapsStayConsistentAfterReset(): void
178
189
$ container = $ kernel ->getContainer ();
179
190
$ registry = $ container ->get ('doctrine ' );
180
191
$ entityManager = $ container ->get ('doctrine.orm.default_entity_manager ' );
181
- $ repository = $ entityManager ->getRepository (TestCustomClassRepoEntity::class);
182
192
183
- $ this ->assertInstanceOf (interface_exists (LazyObjectInterface::class) ? LazyObjectInterface::class : ProxyInterface::class, $ entityManager );
193
+ if (PHP_VERSION_ID < 80400 ) {
194
+ $ this ->assertInstanceOf (interface_exists (LazyObjectInterface::class) ? LazyObjectInterface::class : ProxyInterface::class, $ entityManager );
195
+ }
196
+
184
197
assert ($ entityManager instanceof EntityManagerInterface);
185
198
assert ($ registry instanceof Registry);
199
+
200
+ $ repository = $ entityManager ->getRepository (TestCustomClassRepoEntity::class);
186
201
assert ($ repository instanceof TestCustomClassRepoRepository);
187
202
188
203
$ entity = new TestCustomClassRepoEntity ();
0 commit comments