Node fail callback
public onNodeFailure ( Psecio\Parse\RuleInterface $rule, PhpParser\Node $node, Psecio\Parse\File $file ) : void | ||
$rule | Psecio\Parse\RuleInterface | |
$node | PhpParser\Node | |
$file | Psecio\Parse\File | |
Résultat | void |
public function testCallbackOnIssue() { $dispatcher = m::mock('\\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->shouldReceive('dispatch')->once()->with(Scanner::FILE_ISSUE, m::type('\\Psecio\\Parse\\Event\\IssueEvent'))->mock(); $scanner = new Scanner($dispatcher, m::mock('\\Psecio\\Parse\\CallbackVisitor')->shouldReceive('onNodeFailure')->mock()); $scanner->onNodeFailure(m::mock('\\Psecio\\Parse\\RuleInterface'), m::mock('\\PhpParser\\Node'), m::mock('\\Psecio\\Parse\\File')); }