Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
Unit test for Graph with polygonal shapes
3
--FILE--
4
<?php
5
 
6
/**
7
 * Test 5: "Graph with polygonal shapes"
8
 *
9
 * Graph definition taken from GraphViz documentation
10
 *
11
 * @category Image
12
 * @package  Image_GraphViz
13
 * @author   Philippe Jausions <jausions@php.net>
14
 */
15
require_once 'Image/GraphViz.php';
16
 
17
$graph = new Image_GraphViz(true, null, 'G', false);
18
 
19
$graph->addNode('a', array('shape' => 'polygon',
20
                           'sides' => 5,
21
                           'peripheries' => 3,
22
                           'color' => 'lightblue',
23
                           'style' => 'filled'));
24
$graph->addNode('c', array('shape' => 'polygon',
25
                           'sides' => 4,
26
                           'skew' => .4,
27
                           'label' => 'hello world'));
28
$graph->addNode('d', array('shape' => 'invtriangle'));
29
$graph->addNode('e', array('shape' => 'polygon',
30
                           'sides' => 4,
31
                           'distortion' => .7));
32
 
33
$graph->addEdge(array('a' => 'b'));
34
$graph->addEdge(array('b' => 'c'));
35
$graph->addEdge(array('b' => 'd'));
36
 
37
echo $graph->parse();
38
 
39
?>
40
--EXPECT--
41
digraph G {
42
    a [ shape=polygon,sides=5,peripheries=3,color=lightblue,style=filled ];
43
    c [ shape=polygon,sides=4,skew=0.4,label="hello world" ];
44
    d [ shape=invtriangle ];
45
    e [ shape=polygon,sides=4,distortion=0.7 ];
46
    a -> b;
47
    b -> c;
48
    b -> d;
49
}