public function testSaveToEntity() { $this->formEntityProcessor->saveToEntity($this->standardEntity, $this->formData); $this->assertEquals($this->formData['name'], $this->standardEntity->getName()); $this->assertEquals($this->formData['description'], $this->standardEntity->getDescription()); $this->assertEquals($this->formData['published'], $this->standardEntity->getPublished()); }
public function testSaveToAndGetClonedEntities() { $entity = new StandardFormEntity(); $entity->setName('Name One'); $entity->setDescription('Description One'); $entity->setCategory('5'); $entity->setPassword('Secure One'); $this->standard_form_handler->bindEntity($entity); $_POST = $this->standard_form_request; $this->standard_form_handler->handleRequest(); $clones = $this->standard_form_handler->saveToAndGetClonedEntities(); $this->assertEquals('Name One', $entity->getName()); $this->assertEquals('Example Name', $clones[0]['entity']->getName()); }