public function testGraphDirectedLoop() { // 1 -> 1 $graph = new Graph(); $graph->createVertex(1)->createEdgeTo($v1 = $graph->getVertex(1)); $alg = new AlgorithmLoop($graph); $this->assertTrue($alg->hasLoop()); $this->assertTrue($alg->hasLoopVertex($v1)); }