/** * @test */ public function hasUnpersistedChangesReturnsTrueAfterObjectUpdate() { $this->removeExampleEntities(); $this->insertExampleEntity(); $this->persistenceManager->persistAll(); /** @var TestEntity $testEntity */ $testEntity = $this->testEntityRepository->findAll()->getFirst(); $testEntity->setName('Another name'); $this->testEntityRepository->update($testEntity); $this->assertTrue($this->persistenceManager->hasUnpersistedChanges()); }
/** * @test */ public function validationIsOnlyDoneForPropertiesWhichAreInTheDefaultOrPersistencePropertyGroup() { $this->removeExampleEntities(); $this->insertExampleEntity(); $this->persistenceManager->persistAll(); $testEntity = $this->testEntityRepository->findOneByName('Flow'); // We now make the TestEntities Description *invalid*, and still // expect that the saving works without exception. $testEntity->setDescription(''); $this->testEntityRepository->update($testEntity); $this->persistenceManager->persistAll(); // dummy assertion to suppress PHPUnit warning $this->assertTrue(TRUE); }
/** * @param \TYPO3\Flow\Tests\Functional\Persistence\Fixtures\TestEntity $entity * @return string */ public function updateAction(TestEntity $entity) { $this->testEntityRepository->update($entity); return sprintf('Entity "%s" updated', $entity->getName()); }