/** * @test */ public function hasUnpersistedChangesReturnsTrueAfterObjectUpdate() { $this->removeExampleEntities(); $this->insertExampleEntity(); $this->persistenceManager->persistAll(); /** @var Fixtures\TestEntity $testEntity */ $testEntity = $this->testEntityRepository->findAll()->getFirst(); $testEntity->setName('Another name'); $this->testEntityRepository->update($testEntity); $this->assertTrue($this->persistenceManager->hasUnpersistedChanges()); }
/** * @param TestEntity $entity * @return string */ public function updateAction(TestEntity $entity) { $this->testEntityRepository->update($entity); return sprintf('Entity "%s" updated', $entity->getName()); }