Пример #1
0
 public function setUp()
 {
     /** @var FormElementManager $formElementManager */
     $formElementManager = $this->getMock('Zend\\Mvc\\Controller\\ControllerManager');
     $this->formElementManager = $formElementManager;
     /** @var ServiceLocatorInterface $serviceLocator */
     $serviceLocator = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface');
     $this->serviceLocator = $serviceLocator;
     $this->formElementManager->expects($this->any())->method('getServiceLocator')->willReturn($serviceLocator);
     $factory = new CaptchaFormFactory();
     $this->factory = $factory;
 }
 public function testRegistryValuesActionPostValid()
 {
     $postData = array('key' => 'value');
     $form = $this->createMock('Console\\Form\\ManageRegistryValues');
     $form->expects($this->once())->method('process');
     $form->expects($this->once())->method('setData')->with($postData);
     $form->expects($this->once())->method('isValid')->will($this->returnValue(true));
     $form->expects($this->never())->method('render');
     $this->_formManager->expects($this->once())->method('get')->with('Console\\Form\\ManageRegistryValues')->will($this->returnValue($form));
     $this->dispatch('/console/preferences/registryvalues/', 'POST', $postData);
     $this->assertRedirectTo('/console/preferences/registryvalues/');
 }