1 | <?php |
||
18 | class GraphFormatterTest extends \PHPUnit_Framework_TestCase { |
||
19 | |||
20 | /* |
||
21 | * @see https://www.semantic-mediawiki.org/wiki/Help:Graph_format |
||
22 | */ |
||
23 | |||
24 | private $options = [ |
||
25 | 'graphName' => "Unit Test", |
||
26 | 'graphSize' => "100", |
||
27 | 'nodeShape' => "rect", |
||
28 | 'nodeLabel' => "displaytitle", |
||
29 | 'rankDir' => "TB", |
||
30 | 'wordWrapLimit' => "20", |
||
31 | 'parentRelation' => "parent", |
||
32 | 'enableGraphLink' => "yes", |
||
33 | 'showGraphLabel' => "yes", |
||
34 | 'showGraphColor' => "yes", |
||
35 | 'showGraphLegend' => "yes", |
||
36 | ]; |
||
37 | |||
38 | private $graphFormatter; |
||
39 | |||
40 | private $nodes = []; |
||
41 | |||
42 | protected function setUp() { |
||
63 | |||
64 | public function testCanConstruct() { |
||
67 | |||
68 | |||
69 | public function testGetWordWrappedText() { |
||
75 | |||
76 | public function testGetGraphLegend() { |
||
82 | |||
83 | |||
84 | /* |
||
85 | public function testBuildGraph() { |
||
86 | $expected = "digraph Unit Test {graph [fontsize=10, fontname=\"Verdana\"]\nnode [fontsize=10, fontname=\"Verdana\"];\nedge [fontsize=10, fontname=\"Verdana\"];\nsize=\"100\";node [shape=rect];rankdir=TB;\"Team:Alpha\" [URL = \"[[Team:Alpha]]\", label = \"Alpha\"]; \"Team:Beta\" [URL = \"[[Team:Beta]]\", label = \"Beta\"]; \"Person:Alexander Gesinn\" -> \"Team:Alpha\" [label=\"Casted\",fontcolor=black,color=black]; \"Person:Sebastian Schmid\" -> \"Team:Beta\" [label=\"Casted\",fontcolor=black,color=black]; \"Person:Alexander Gesinn\" -> \"Team:Beta\" [label=\"Casted\",fontcolor=black,color=black]; \"Team:Alpha\" -> \"Team:Beta\" [label=\"Part of Team \",fontcolor=red,color=red];}\n"; |
||
87 | |||
88 | |||
89 | print('----------actual------------'); |
||
90 | print($this->graphFormatter->getGraph()); |
||
91 | print('-------------'); |
||
92 | |||
93 | |||
94 | print('------expected-------'); |
||
95 | print($expected); |
||
96 | print('-------------'); |
||
97 | |||
98 | |||
99 | $this->assertEquals( $this->graphFormatter->getGraph(), $expected ); |
||
100 | } |
||
101 | */ |
||
102 | } |
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: