Fhaculty\Graph\Tests\WalkTest::testWalkLoopCycle PHP Method

testWalkLoopCycle() public method

public testWalkLoopCycle ( )
    public function testWalkLoopCycle()
    {
        // 1 -- 1
        $graph = new Graph();
        $v1 = $graph->createVertex(1);
        $e1 = $v1->createEdge($v1);
        $walk = Walk::factoryCycleFromEdges(array($e1), $v1);
        $this->assertEquals(2, count($walk->getVertices()));
        $this->assertEquals(1, count($walk->getEdges()));
        $this->assertSame($v1, $walk->getVertices()->getVertexFirst());
        $this->assertSame($v1, $walk->getVertices()->getVertexLast());
        $this->assertTrue($walk->isValid());
    }