public function testEditActionPostInvalid()
 {
     $postData = array('Type' => 'type', 'Description' => 'description');
     $macAddress = $this->getMockBuilder('Library\\MacAddress')->disableOriginalConstructor()->getMock();
     $macAddress->expects($this->any())->method('__toString')->will($this->returnValue('00:00:5E:00:53:00'));
     $macAddress->expects($this->any())->method('getVendor')->will($this->returnValue('vendor'));
     $device = array('MacAddress' => $macAddress, 'IpAddress' => '192.0.2.1', 'Hostname' => 'host.example.net', 'DiscoveryDate' => 'date');
     $this->_deviceManager->method('getDevice')->with('00:00:5E:00:53:00')->willReturn($device);
     $this->_deviceManager->expects($this->once())->method('getTypes')->willReturn(array());
     $this->_deviceForm = $this->getMockBuilder('Console\\Form\\NetworkDevice')->setMethods(array('isValid', 'prepare', 'setData'))->getMock();
     $this->_deviceForm->expects($this->once())->method('setData')->with($postData);
     $this->_deviceForm->expects($this->once())->method('isValid')->will($this->returnValue(false));
     $this->_deviceForm->expects($this->once())->method('prepare');
     $this->_deviceForm->setOption('DeviceManager', $this->_deviceManager);
     $this->_deviceForm->init();
     $this->_deviceForm->get('Description')->setMessages(array('message'));
     $this->dispatch('/console/network/edit/?macaddress=00:00:5E:00:53:00', 'POST', $postData);
     $this->assertResponseStatusCode(200);
     $this->assertXpathQuery('//*[@class="error"]//*[text()="message"]');
 }