コード例 #1
0
 public function testInvalidStylesOption()
 {
     $this->setExpectedException(Error::CLASS, 'Encountered unexpected value type for "styles" option.' . ' Expected instance of Params\\Immutable\\ImmutableOptions');
     $state_machine_definition_file = __DIR__ . '/Fixture/state_machine.xml';
     $builder = new XmlStateMachineBuilder(['state_machine_definition' => $state_machine_definition_file, 'name' => 'video_transcoding']);
     $state_machine = $builder->build();
     $renderer = new DotGraphRenderer(['style' => 'not what you\'d expected hugh? :P']);
     $dot_code = $renderer->renderGraph($state_machine);
 }
 protected function doRender()
 {
     $renderer = new DotGraphRenderer();
     $dot_graph = $renderer->renderGraph($this->state_machine);
     $process = new Process('dot -Tsvg');
     $process->setInput($dot_graph);
     $process->run();
     if (!$process->isSuccessful()) {
         throw new RuntimeError($process->getErrorOutput());
     }
     return $process->getOutput();
 }