Creitive\Breadcrumbs\BreadcrumbsTest::testIsAbleToEnchainAddMethod PHP Method

testIsAbleToEnchainAddMethod() public method

public testIsAbleToEnchainAddMethod ( $crumbs )
    public function testIsAbleToEnchainAddMethod($crumbs)
    {
        $b = new Breadcrumbs();
        $n = count($crumbs);
        switch ($n) {
            case 1:
                $b->add($crumbs[0]);
                break;
            case 2:
                $b->add($crumbs[0])->add($crumbs[1]);
                break;
            case 3:
                $b->add($crumbs[0])->add($crumbs[1])->add($crumbs[2]);
                break;
            case 4:
                $b->add($crumbs[0])->add($crumbs[1])->add($crumbs[2])->add($crumbs[3]);
                break;
            case 5:
                $b->add($crumbs[0])->add($crumbs[1])->add($crumbs[2])->add($crumbs[3])->add($crumbs[4]);
                break;
            default:
                throw new Exception('Test does not handle more than 5 breadcrumbs.');
                break;
        }
        $this->assertCount($n, $b->getBreadcrumbs());
    }