Skip to content

Commit

Permalink
First attempt at fixing the project for Doctrine ORM 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Jun 10, 2024
1 parent 8b6c672 commit bb5484f
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 178 deletions.
8 changes: 6 additions & 2 deletions src/ArrayFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ public function load(ObjectManager $manager): void
{
$this->manager = $manager;

if ($this->manager instanceof EntityManagerInterface && $this->disableLogger()) {
$this->manager->getConnection()->getConfiguration()->setSQLLogger(null);
if (
$this->manager instanceof EntityManagerInterface
&& $this->disableLogger()
&& \method_exists($dbConfiguration = $this->manager->getConnection()->getConfiguration(), 'setSQLLogger')
) {
$dbConfiguration->setSQLLogger(null);
}

$objects = $this->getObjects();
Expand Down
2 changes: 1 addition & 1 deletion tests/ArrayFixtureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function test documents with ids(): void

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

return new ObjectManagerStub($metadata);
Expand Down
Loading

0 comments on commit bb5484f

Please sign in to comment.