public function testCanCreateEntityWithNewGroup() { $this->em->clear(); $groupKey = $this->generateRandomString(5); $group = new Group(); $group->setKey($groupKey); $customer = new Customer(); $customer->setGroup($group); $this->assertEmpty($customer->getId()); $this->assertEquals($group, $customer->getGroup()); $this->assertEmpty($customer->getGroup()->getId()); $this->assertEquals($groupKey, $customer->getGroup()->getKey()); return $customer; }
/** * {@inheritDoc} */ public function setKey($key) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setKey', array($key)); return parent::setKey($key); }