/** * Adds a Role object to the ArrayCollection. Can't type hint due to interface so throws Exception. * * @param Role $role * * @return GroupInterface * @throws InvalidArgumentException */ public function addRole($role) { if (!$role instanceof Role) { throw new InvalidArgumentException("addRole takes a Role object as the parameter"); } if (!$this->hasRole($role->getRole())) { $this->roles->add($role); } return $this; }
/** * @covers Kunstmaan\AdminBundle\Entity\Role::getId */ public function testGetId() { $this->assertEquals(null, $this->object->getId()); }