Sonata\Tests\Component\Delivery\SelectorTest::testGetAvailableMethodsWithFilledBasket PHP Method

testGetAvailableMethodsWithFilledBasket() public method

Test the getAvailableMethods methods with a product provided but no address and no related delivery methods.
    public function testGetAvailableMethodsWithFilledBasket()
    {
        $deliveryPool = new DeliveryPool();
        $productPool = new ProductPool();
        $basket = $this->getMock('Sonata\\Component\\Basket\\Basket');
        $basketElement = $this->getMock('Sonata\\Component\\Basket\\BasketElement');
        $product = $this->getMock('Sonata\\Tests\\Component\\Delivery\\Product');
        $basket->expects($this->once())->method('getBasketElements')->will($this->returnValue(array($basketElement)));
        $basketElement->expects($this->once())->method('getProduct')->will($this->returnValue($product));
        $product->expects($this->once())->method('getDeliveries')->will($this->returnValue(array()));
        $selector = new Selector($deliveryPool, $productPool);
        $this->assertEmpty($selector->getAvailableMethods($basket));
    }