raoul2000\workflow\base\Status::getTransitions PHP Method

getTransitions() public method

See also: raoul2000\workflow\base\StatusInterface::getTransitions()
public getTransitions ( )
    public function getTransitions()
    {
        if ($this->getSource() === null) {
            throw new WorkflowException('no workflow source component available');
        }
        return $this->getSource()->getTransitions($this->getId());
    }

Usage Example

 public function testStatusAccessorFails()
 {
     $st = new Status(['id' => 'draft', 'workflowId' => 'workflow1']);
     $this->specify('Failed to get transitions when no source is configured', function () use($st) {
         $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available');
         $st->getTransitions();
     });
     $this->specify('Failed to get workflow object when no source is configured', function () use($st) {
         $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available');
         $st->getWorkflow();
     });
     $this->specify('Failed to call isInitialStatus when no source is configured', function () use($st) {
         $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available');
         $st->getWorkflow();
     });
 }