/** * @param ObjectManager $om */ protected function persistDemoEmbeddedForm(ObjectManager $om) { $embeddedForm = new EmbeddedForm(); /** @var ContactRequestType $contactUs */ $contactUs = $this->container->get('orocrm_contact_us.embedded_form'); $embeddedForm->setFormType('orocrm_contact_us.embedded_form'); $embeddedForm->setCss($contactUs->getDefaultCss()); $embeddedForm->setSuccessMessage($contactUs->getDefaultSuccessMessage()); $embeddedForm->setTitle('Contact Us Form'); $embeddedForm->setOwner($this->organization); $om->persist($embeddedForm); }
/** * @test */ public function shouldSetEntityPropertiesAndReturnBack() { $formType = uniqid('AnyFormType'); $css = uniqid('styles'); $title = uniqid('title'); $successMessage = uniqid('success message'); $formEntity = new EmbeddedForm(); $formEntity->setFormType($formType); $formEntity->setCss($css); $formEntity->setTitle($title); $formEntity->setSuccessMessage($successMessage); $this->assertEquals($formType, $formEntity->getFormType()); $this->assertEquals($css, $formEntity->getCss()); $this->assertEquals($title, $formEntity->getTitle()); $this->assertEquals($successMessage, $formEntity->getSuccessMessage()); }
public function load(ObjectManager $manager) { /** @var Organization $organization */ $organization = $manager->getRepository('OroOrganizationBundle:Organization')->getFirst(); /** @var Organization $organization */ $branches = $manager->getRepository('DiamanteDeskBundle:Branch')->getAll(); $branch = current($branches); $ASCIIKey = ord('A'); for ($i = 1; $i <= 10; $i++) { $keySuffix = chr($ASCIIKey + $i); $form = new EmbeddedForm(); $form->setTitle('Form' . $keySuffix); $form->setFormType('diamante_embedded_form.form_type.available_embedded_form'); $form->setSuccessMessage('Ticket has been placed successfully'); $form->setCss(''); $form->setOwner($organization); $form->setBranch($branch); $manager->persist($form); } $manager->flush(); }