Symfony\Component\Form\Tests\CompoundFormTest::testClickedButton PHP Method

testClickedButton() public method

public testClickedButton ( )
    public function testClickedButton()
    {
        $button = $this->getMockBuilder('Symfony\Component\Form\SubmitButton')
            ->setConstructorArgs(array(new SubmitButtonBuilder('submit')))
            ->setMethods(array('isClicked'))
            ->getMock();

        $button->expects($this->any())
            ->method('isClicked')
            ->will($this->returnValue(true));

        $this->form->add($button);
        $this->form->submit(array());

        $this->assertSame($button, $this->form->getClickedButton());
    }
CompoundFormTest