コード例 #1
0
ファイル: Workflow.php プロジェクト: netzmacht/workflow
 /**
  * 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());
 }
コード例 #2
0
ファイル: WorkflowSpec.php プロジェクト: netzmacht/workflow
 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));
 }