1 | <?php |
||
17 | class GraphFormatterTest extends \PHPUnit_Framework_TestCase { |
||
18 | |||
19 | /* |
||
20 | * @see https://www.semantic-mediawiki.org/wiki/Help:Graph_format |
||
21 | */ |
||
22 | private $options; |
||
23 | |||
24 | private $graphFormatter; |
||
25 | |||
26 | private $nodes = []; |
||
27 | |||
28 | protected function setUp() { |
||
29 | parent::setUp(); |
||
30 | |||
31 | $this->options->graphName = 'Unit Test'; |
||
32 | $this->options->graphSize = '100'; |
||
33 | $this->options->nodeShape = 'rect'; |
||
34 | $this->options->nodeLabel = 'displaytitle'; |
||
35 | $this->options->rankDir = 'TB'; |
||
36 | $this->options->wordWrapLimit = '20'; |
||
37 | $this->options->parentRelation = 'parent'; |
||
38 | $this->options->enableGraphLink = 'yes'; |
||
39 | $this->options->showGraphLabel = 'yes'; |
||
40 | $this->options->showGraphColor = 'yes'; |
||
41 | $this->options->showGraphLegend = 'yes'; |
||
42 | |||
43 | $this->graphFormatter = new GraphFormatter( $this->options ); |
||
44 | |||
45 | $this->nodes = []; |
||
46 | |||
47 | $node1 = new GraphNode( 'Team:Alpha' ); |
||
48 | $node1->setLabel( "Alpha" ); |
||
49 | $node1->addParentNode( "Casted", "Person:Alexander Gesinn" ); |
||
50 | $this->nodes[] = $node1; |
||
51 | |||
52 | $node2 = new GraphNode( 'Team:Beta' ); |
||
53 | $node2->setLabel( "Beta" ); |
||
54 | $node2->addParentNode( "Casted", "Person:Sebastian Schmid" ); |
||
55 | $node2->addParentNode( "Casted", "Person:Alexander Gesinn" ); |
||
56 | $node2->addParentNode( "Part of Team ", "Team:Alpha" ); |
||
57 | $this->nodes[] = $node2; |
||
58 | |||
59 | $this->graphFormatter->buildGraph( $this->nodes ); |
||
|
|||
60 | } |
||
61 | |||
62 | public function testCanConstruct() { |
||
65 | |||
66 | public function testGetWordWrappedText() { |
||
72 | |||
73 | public function testGetGraphLegend() { |
||
81 | |||
82 | public function testBuildGraph(){ |
||
96 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: