Example #1
0
 public function testLoadFile()
 {
     $graph = Graph::loadFile(__DIR__ . '/../../../examples/linecount/count.json');
     $readFile = $graph->getNode('ReadFile');
     $this->assertEquals('ReadFile', $readFile['id']);
     $this->assertEquals(4, count($graph->nodes));
 }
Example #2
0
 /**
  * Load PhpFlo graph definition from file.
  *
  * @param string $file
  * @return \PhpFlo\Network
  */
 public static function loadFile($file)
 {
     $graph = Graph::loadFile($file);
     return Network::create($graph);
 }