/** * @test */ public function itShouldCallScanAndNotWriteOnFailure() { $this->detector->scan($this->node)->shouldBeCalled()->willReturn(false); $this->detector->isBoolExpression($this->node)->shouldBeCalled()->willReturn(true); $this->analyser->foundAssumption(Argument::any(), Argument::any())->shouldNotBeCalled(); $this->analyser->foundBoolExpression()->shouldBeCalled(); $this->nodeVisitor->enterNode($this->node->reveal()); }
/** * @param Node $node * @return false|null|Node|\PhpParser\Node[]|void */ public function enterNode(Node $node) { if ($this->detector->isBoolExpression($node)) { $this->analyser->foundBoolExpression(); } if ($this->detector->scan($node)) { $this->analyser->foundAssumption($node->getLine()); } }