public function setUp() { $this->state = $this->getMock('\\StateMachine\\StateInterface'); $this->process = $this->getMock('\\StateMachine\\ProcessInterface'); $this->process->expects($this->any())->method('getStates')->willReturn([$this->state]); $this->adapter = $this->getMock('\\StateMachine\\AdapterInterface'); $this->adapter->expects($this->any())->method('getProcess')->willReturn($this->process); }
/** * Build dot document from process structure * * @param AdapterInterface $adapter process/schema adapter * * @return Document */ public function build(AdapterInterface $adapter) { $document = new Document($adapter->getProcess()->getName(), $this->stylist->getDPI(), $this->stylist->getFont()); foreach ($adapter->getProcess()->getStates() as $state) { $this->addState($document, $state); foreach ($state->getEvents() as $event) { $this->addEvent($document, $state, $event); } } return $document; }