| @@ 296-305 (lines=10) @@ | ||
| 293 | $this->assertContains('FooException', $symbols); |
|
| 294 | } |
|
| 295 | ||
| 296 | public function testTraits() |
|
| 297 | { |
|
| 298 | $node = new TraitUse([new Name('Foo')]); |
|
| 299 | ||
| 300 | $this->visitor->enterNode($node); |
|
| 301 | ||
| 302 | $symbols = $this->visitor->getCollectedSymbols(); |
|
| 303 | $this->assertCount(1, $symbols); |
|
| 304 | $this->assertContains('Foo', $symbols); |
|
| 305 | } |
|
| 306 | ||
| 307 | public function testBeforeTraverseResetsRecordedSymbols() |
|
| 308 | { |
|
| @@ 307-316 (lines=10) @@ | ||
| 304 | $this->assertContains('Foo', $symbols); |
|
| 305 | } |
|
| 306 | ||
| 307 | public function testBeforeTraverseResetsRecordedSymbols() |
|
| 308 | { |
|
| 309 | $node = new Class_('Foo'); |
|
| 310 | $node->extends = new Name('Bar'); |
|
| 311 | $this->visitor->enterNode($node); |
|
| 312 | ||
| 313 | $this->visitor->beforeTraverse([]); |
|
| 314 | ||
| 315 | $this->assertCount(0, $this->visitor->getCollectedSymbols()); |
|
| 316 | } |
|
| 317 | } |
|
| 318 | ||