Skip to content

Commit

Permalink
Merge pull request #18 from svycka/fix-deprecated-flush
Browse files Browse the repository at this point in the history
fixed: Calling Doctrine\ORM\EntityManager::flush() with any arguments…
  • Loading branch information
svycka authored Sep 18, 2020
2 parents cee0374 + 4fc7f00 commit d149d12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ All Notable changes to `svycka/sv-settings` will be documented in this file
- Nothing

### Fixed
- Nothing
- [BC Break] Will call flush() on Doctrine entityManager without specific entity because it is deprecated

### Removed
- Nothing
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/DoctrineStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function set(CollectionInterface $collection, $identifier, $name, $value)
$setting->setValue($value);

$this->entityManager->persist($setting);
$this->entityManager->flush($setting);
$this->entityManager->flush();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Settings/Storage/DoctrineStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function (SettingInterface $value) {
);
$entityManager = $this->prophesize(EntityManagerInterface::class);
$entityManager->persist($entity)->shouldBeCalled();
$entityManager->flush($entity)->shouldBeCalled();
$entityManager->flush()->shouldBeCalled();
$repository = $this->prophesize(ObjectRepository::class);
$repository->findOneBy([
'collection' => $this->collection->getOptions()->getName(),
Expand All @@ -74,7 +74,7 @@ public function testCanUpdate()
$setting->setValue($value = 'F')->shouldBeCalled();
$entityManager = $this->prophesize(EntityManagerInterface::class);
$entityManager->persist($setting->reveal())->shouldBeCalled();
$entityManager->flush($setting->reveal())->shouldBeCalled();
$entityManager->flush()->shouldBeCalled();

$repository = $this->prophesize(ObjectRepository::class);
$repository->findOneBy([
Expand Down

0 comments on commit d149d12

Please sign in to comment.