/** * Gard that role belongs to the workflow. * * @param Role $role Role to be a valid workflow role. * * @return void * * @throws InvalidArgumentException If role is not the same workflow. */ private function guardWorkflowRole(Role $role) { Assertion::eq($role->getWorkflowName(), $this->getName()); }
function it_adds_a_role(Role $role) { $role->getName()->willReturn('acl'); $role->getWorkflowName()->willReturn(static::NAME); $this->addRole($role)->shouldReturn($this); $this->getRole('acl')->shouldReturn($role); $this->getRoles()->shouldReturn(array($role)); }