コード例 #1
-1
ファイル: GraphVizTest.php プロジェクト: graphp/graphviz
    public function testEscaping()
    {
        $graph = new Graph();
        $graph->createVertex('a');
        $graph->createVertex('b¹²³ is; ok\\ay, "right"?');
        $graph->createVertex(3);
        $graph->createVertex(4)->setAttribute('graphviz.label', 'normal');
        $graph->createVertex(5)->setAttribute('graphviz.label', GraphViz::raw('<raw>'));
        $expected = <<<VIZ
graph G {
  "a"
  "b¹²³ is; ok\\\\ay, &quot;right&quot;?"
  3
  4 [label="normal"]
  5 [label=<raw>]
}

VIZ;
        $this->assertEquals($expected, $this->graphViz->createScript($graph));
    }