1 | <?php |
||
21 | |||
22 | /** |
||
23 | * Test for the the class representing a GraphViz graph. |
||
24 | * |
||
25 | * @package phpDocumentor\GraphViz\Tests |
||
26 | * @author Mike van Riel <[email protected]> |
||
27 | * @license http://www.opensource.org/licenses/mit-license.php MIT |
||
28 | * @link http://phpDocumentor-project.org |
||
29 | */ |
||
30 | class GraphTest extends TestCase |
||
31 | { |
||
32 | /** |
||
33 | * @var Graph |
||
34 | */ |
||
35 | protected $fixture; |
||
36 | |||
37 | /** |
||
38 | * Sets up the fixture, for example, opens a network connection. |
||
39 | * This method is called before a test is executed. |
||
40 | */ |
||
41 | protected function setUp() |
||
45 | |||
46 | /** |
||
47 | * Tears down the fixture, for example, closes a network connection. |
||
48 | * This method is called after a test is executed. |
||
49 | */ |
||
50 | protected function tearDown() |
||
54 | |||
55 | /** |
||
56 | * @covers phpDocumentor\GraphViz\Graph::create |
||
57 | */ |
||
58 | public function testCreate() |
||
84 | |||
85 | /** |
||
86 | * @covers phpDocumentor\GraphViz\Graph::setName |
||
87 | */ |
||
88 | public function testSetName() |
||
96 | |||
97 | /** |
||
98 | * @covers phpDocumentor\GraphViz\Graph::getName |
||
99 | */ |
||
100 | public function testGetName() |
||
114 | |||
115 | /** |
||
116 | * @covers phpDocumentor\GraphViz\Graph::setType |
||
117 | */ |
||
118 | public function testSetType() |
||
136 | |||
137 | /** |
||
138 | * @covers phpDocumentor\GraphViz\Graph::setType |
||
139 | */ |
||
140 | public function testSetTypeException() |
||
145 | |||
146 | /** |
||
147 | * @covers phpDocumentor\GraphViz\Graph::getType |
||
148 | */ |
||
149 | public function testGetType() |
||
161 | |||
162 | public function testSetStrict() |
||
175 | |||
176 | public function testIsStrict() |
||
188 | |||
189 | public function testSetPath() |
||
197 | |||
198 | /** |
||
199 | * @covers phpDocumentor\GraphViz\Graph::__call |
||
200 | */ |
||
201 | public function test__call() |
||
207 | |||
208 | /** |
||
209 | * @covers phpDocumentor\GraphViz\Graph::addGraph |
||
210 | */ |
||
211 | public function testAddGraph() |
||
222 | |||
223 | /** |
||
224 | * @covers phpDocumentor\GraphViz\Graph::hasGraph |
||
225 | */ |
||
226 | public function testHasGraph() |
||
236 | |||
237 | /** |
||
238 | * @covers phpDocumentor\GraphViz\Graph::getGraph |
||
239 | */ |
||
240 | public function testGetGraph() |
||
252 | |||
253 | /** |
||
254 | * @covers phpDocumentor\GraphViz\Graph::setNode |
||
255 | */ |
||
256 | public function testSetNode() |
||
266 | |||
267 | /** |
||
268 | * @covers phpDocumentor\GraphViz\Graph::findNode |
||
269 | */ |
||
270 | public function testFindNode() |
||
295 | |||
296 | /** |
||
297 | * @covers phpDocumentor\GraphViz\Graph::__set |
||
298 | */ |
||
299 | public function test__set() |
||
308 | |||
309 | /** |
||
310 | * @covers phpDocumentor\GraphViz\Graph::__get |
||
311 | */ |
||
312 | public function test__get() |
||
322 | |||
323 | /** |
||
324 | * @covers phpDocumentor\GraphViz\Graph::link |
||
325 | */ |
||
326 | public function testLink() |
||
335 | |||
336 | /** |
||
337 | * @covers phpDocumentor\GraphViz\Graph::export |
||
338 | */ |
||
339 | public function testExportException() |
||
347 | |||
348 | /** |
||
349 | * @covers phpDocumentor\GraphViz\Graph::export |
||
350 | */ |
||
351 | public function testExport() |
||
362 | |||
363 | /** |
||
364 | * @covers phpDocumentor\GraphViz\Graph::__toString |
||
365 | */ |
||
366 | public function test__toString() |
||
386 | |||
387 | /** |
||
388 | * Help avoid issue of "#Warning: Strings contain different line endings!" on Windows. |
||
389 | */ |
||
390 | private function normalizeLineEndings($string) |
||
394 | } |
||
395 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: