Skip to content

Commit b4b37f8

Browse files
committed
Fic ORM <3.4 compat
1 parent 5d1f287 commit b4b37f8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/Feature/EntityManagerFactoryTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
use function array_key_exists;
4949
use function count;
50+
use function method_exists;
5051
use function rmdir;
5152

5253
use const PHP_VERSION_ID;
@@ -975,9 +976,12 @@ protected function mockORMConfiguration(): void
975976
->andReturn(false);
976977
}
977978

978-
$this->configuration->shouldReceive('isNativeLazyObjectsEnabled')
979-
->atLeast()->once()
980-
->andReturn(true);
979+
if (method_exists(Configuration::class, 'isNativeLazyObjectsEnabled')) {
980+
// ORM 3.4+
981+
$this->configuration->shouldReceive('isNativeLazyObjectsEnabled')
982+
->atLeast()->once()
983+
->andReturn(true);
984+
}
981985

982986
$this->configuration->shouldReceive('setProxyDir')
983987
->atLeast()->once()

0 commit comments

Comments
 (0)