public function testPutAddressInvalidAction()
{
$address = $this->getMock('Sonata\\CustomerBundle\\Model\\AddressInterface');
$addressManager = $this->getMock('Sonata\\Component\\Customer\\AddressManagerInterface');
$addressManager->expects($this->once())->method('findOneBy')->will($this->returnValue($address));
$addressManager->expects($this->never())->method('save')->will($this->returnValue($address));
$form = $this->getMockBuilder('Symfony\\Component\\Form\\Form')->disableOriginalConstructor()->getMock();
$form->expects($this->once())->method('bind');
$form->expects($this->once())->method('isValid')->will($this->returnValue(false));
$formFactory = $this->getMock('Symfony\\Component\\Form\\FormFactoryInterface');
$formFactory->expects($this->once())->method('createNamed')->will($this->returnValue($form));
$view = $this->createAddressController($address, $addressManager, $formFactory)->putAddressAction(1, new Request());
$this->assertInstanceOf('Symfony\\Component\\Form\\FormInterface', $view);
}