1 | <?php |
||
23 | class NodeTest extends TestCase |
||
24 | { |
||
25 | /** @var Node */ |
||
26 | protected $fixture = null; |
||
27 | |||
28 | /** |
||
29 | * Initializes the fixture for this test. |
||
30 | */ |
||
31 | protected function setUp() : void |
||
35 | |||
36 | /** |
||
37 | * Tests the construct method |
||
38 | * |
||
39 | * @covers \phpDocumentor\GraphViz\Node::__construct |
||
40 | * @returnn void |
||
41 | */ |
||
42 | public function testConstruct() : void |
||
52 | |||
53 | /** |
||
54 | * Tests the create method |
||
55 | * |
||
56 | * @covers \phpDocumentor\GraphViz\Node::create |
||
57 | * @returnn void |
||
58 | */ |
||
59 | public function testCreate() : void |
||
66 | |||
67 | /** |
||
68 | * Tests the getting and setting of the name. |
||
69 | * |
||
70 | * @covers \phpDocumentor\GraphViz\Node::getName |
||
71 | * @covers \phpDocumentor\GraphViz\Node::setName |
||
72 | */ |
||
73 | public function testName() : void |
||
91 | |||
92 | /** |
||
93 | * Tests the magic __call method, to work as described, return the object |
||
94 | * instance for a setX method, return the value for an getX method, and null |
||
95 | * for the remaining method calls |
||
96 | * |
||
97 | * @covers \phpDocumentor\GraphViz\Node::__call |
||
98 | * @covers \phpDocumentor\GraphViz\Node::getAttribute |
||
99 | * @covers \phpDocumentor\GraphViz\Node::setAttribute |
||
100 | */ |
||
101 | public function testCall() : void |
||
108 | |||
109 | /** |
||
110 | * @covers \phpDocumentor\GraphViz\Node::getAttribute |
||
111 | * @covers \phpDocumentor\GraphViz\AttributeNotFound::__construct |
||
112 | */ |
||
113 | public function testGetNonExistingAttributeThrowsAttributeNotFound() : void |
||
120 | |||
121 | /** |
||
122 | * Tests whether the magic __toString method returns a well formatted string |
||
123 | * as specified in the DOT standard |
||
124 | * |
||
125 | * @covers \phpDocumentor\GraphViz\Node::__toString |
||
126 | */ |
||
127 | public function testToString() : void |
||
142 | |||
143 | /** |
||
144 | * Tests whether the magic __toString method returns a well formatted string |
||
145 | * as specified in the DOT standard when the label contains slashes. |
||
146 | * |
||
147 | * @covers \phpDocumentor\GraphViz\Node::__toString |
||
148 | */ |
||
149 | public function testToStringWithLabelContainingSlashes() : void |
||
165 | } |
||
166 |
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: