Example #1
0
 public function testCanCreateEntity()
 {
     $groupKey = $this->generateRandomString(5);
     $group = new Group();
     $group->setKey($groupKey);
     $group->setName('testGroup');
     $group->setTax(true);
     $group->setTaxInput(true);
     $group->setMode(1);
     $anotherGroup = new Group();
     $anotherGroup->setKey($this->generateRandomString(5));
     $anotherGroup->setName('testGroup');
     $anotherGroup->setTax(true);
     $anotherGroup->setTaxInput(true);
     $anotherGroup->setMode(1);
     $customer = new Customer();
     $customer->setEmail('*****@*****.**');
     $customer->setGroup($group);
     $this->em->persist($customer);
     $this->em->persist($group);
     $this->em->persist($anotherGroup);
     $this->em->flush();
     $this->em->clear();
     $this->assertNotEmpty($customer->getId());
     $this->assertNotEmpty($customer->getGroup()->getId());
     return $customer;
 }
 /**
  * {@inheritDoc}
  */
 public function setName($name)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setName', array($name));
     return parent::setName($name);
 }