Sonata\tests\Component\Form\EventListener\BasketResizeFormListenerTest::testPreBindException PHP Method

testPreBindException() public method

    public function testPreBindException()
    {
        $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock();
        $factory = $this->getMock('Symfony\\Component\\Form\\FormFactoryInterface');
        $factory->expects($this->any())->method('createNamedBuilder')->will($this->returnValue($builder));
        $basket = $this->getMock('Sonata\\Component\\Basket\\BasketInterface');
        $basket->expects($this->any())->method('getBasketElements')->will($this->returnValue($this->getBasketElements('test')));
        $formListener = new BasketResizeFormListener($factory, $basket);
        $formListener->preBind($this->getFormEvent(false, false));
    }