Aimeos\ShopBundle\Tests\Controller\CheckoutControllerTest::testStandardNavbar PHP Method

testStandardNavbar() public method

public testStandardNavbar ( )
    public function testStandardNavbar()
    {
        $client = static::createClient(array(), array('PHP_AUTH_USER' => 'UTC001', 'PHP_AUTH_PW' => 'unittest'));
        $crawler = $client->request('GET', '/unittest/de/EUR/list');
        $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
        $crawler = $client->click($link);
        $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form();
        $crawler = $client->submit($form);
        $link = $crawler->filter('.basket-standard .btn-action')->link();
        $crawler = $client->click($link);
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Adresse")')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .address a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .delivery a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
        $form = $crawler->filter('.checkout-standard form')->form();
        $form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value'));
        $crawler = $client->submit($form);
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Versand")')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .delivery a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
        $form = $crawler->filter('.checkout-standard form')->form();
        $form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value'));
        $crawler = $client->submit($form);
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .delivery a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Zahlung")')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
        $form = $crawler->filter('.checkout-standard form')->form();
        $form['c_paymentoption']->select($crawler->filter('.checkout-standard-payment .item-service input')->attr('value'));
        $crawler = $client->submit($form);
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .delivery a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .payment a')->count());
        $this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Übersicht")')->count());
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
        $link = $crawler->filter('.checkout-standard .steps .basket a')->link();
        $crawler = $client->click($link);
        $this->assertEquals(0, $crawler->filter('.checkout-standard .steps')->count());
    }