Sonata\Tests\Component\Transformer\BasketTransformerTest::testInvalidDeliveryMethod PHP Method

testInvalidDeliveryMethod() public method

    public function testInvalidDeliveryMethod()
    {
        $this->setExpectedException('RuntimeException', 'Invalid delivery method');
        $basket = new Basket();
        $customer = $this->getMock('Sonata\\Component\\Customer\\CustomerInterface');
        $billingAddress = $this->getMock('Sonata\\Component\\Customer\\AddressInterface');
        $paymentMethod = $this->getMock('Sonata\\Component\\Payment\\PaymentInterface');
        $basket->setCustomer($customer);
        $basket->setBillingAddress($billingAddress);
        $basket->setPaymentMethod($paymentMethod);
        $currency = new Currency();
        $currency->setLabel('EUR');
        $basket->setCurrency($currency);
        $this->getBasketTransform()->transformIntoOrder($basket);
    }