示例#1
0
 public function testWalkerCapturesAllAnalysisExceptionsAndReturnsThem()
 {
     $ast = $this->parseSource(file_get_contents(STUBPATH . '/walk/class_2.php'));
     $walker = new NodeWalker();
     $errors = $walker->walk($ast, function (Node $node) {
         throw AnalysisException::withNode($node);
     });
     $this->assertCount(9, $errors);
     $this->assertArrayOf(AnalysisException::class, $errors);
 }