public function testComputeFixedPoint() { $graph = new ControlFlowGraph($entry = $this->getAstNode()); $node1 = $this->getAstNode(); $graph->connect($entry, null, $node1); $node2 = $this->getAstNode(); $graph->connect($node1, null, $node2); $node3 = $this->getAstNode(); $graph->connect($node3, null, $node2); $node4 = $this->getAstNode(); $graph->connect($node2, null, $node4); $callback = $this->getMock('Scrutinizer\\PhpAnalyzer\\ControlFlow\\EdgeCallbackInterface'); $t = new FixedPointGraphTraversal($callback); $callback->expects($this->at(0))->method('traverseEdge')->with($entry, null, $node1)->will($this->returnValue(true)); $callback->expects($this->at(1))->method('traverseEdge')->with($node1, null, $node2)->will($this->returnValue(false)); $t->computeFixedPointWithEntry($graph, $entry); }