Skip to content

Commit bb5484f

Browse files
committed
First attempt at fixing the project for Doctrine ORM 3
1 parent 8b6c672 commit bb5484f

File tree

4 files changed

+409
-178
lines changed

4 files changed

+409
-178
lines changed

src/ArrayFixture.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ public function load(ObjectManager $manager): void
7979
{
8080
$this->manager = $manager;
8181

82-
if ($this->manager instanceof EntityManagerInterface && $this->disableLogger()) {
83-
$this->manager->getConnection()->getConfiguration()->setSQLLogger(null);
82+
if (
83+
$this->manager instanceof EntityManagerInterface
84+
&& $this->disableLogger()
85+
&& \method_exists($dbConfiguration = $this->manager->getConnection()->getConfiguration(), 'setSQLLogger')
86+
) {
87+
$dbConfiguration->setSQLLogger(null);
8488
}
8589

8690
$objects = $this->getObjects();

tests/ArrayFixtureTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function test documents with ids(): void
146146

147147
private function getObjectManager(): ObjectManagerStub
148148
{
149-
$metadata = $this->createMock(ClassMetadataInterface::class);
149+
$metadata = $this->createMock(ORMClassMetadata::class);
150150
$metadata->method('getIdentifierFieldNames')->willReturn(['id']); // Default to "id" since composite are not supported yet.
151151

152152
return new ObjectManagerStub($metadata);

0 commit comments

Comments
 (0)