public function setUp()
 {
     $fields = array('TAG' => 'text', 'name0' => 'text', 'name1' => 'integer');
     $this->_customFieldManager = $this->getMockBuilder('Model\\Client\\CustomFieldManager')->disableOriginalConstructor()->getMock();
     $this->_customFieldManager->expects($this->once())->method('getFields')->willReturn($fields);
     parent::setUp();
 }
 public function setUp()
 {
     $fields = array('TAG' => 'text', 'name0' => 'text', 'name1' => 'integer');
     $this->_customFieldManager = $this->createMock('Model\\Client\\CustomFieldManager');
     $this->_customFieldManager->expects($this->once())->method('getFields')->willReturn($fields);
     parent::setUp();
 }
Exemple #3
0
 public function setUp()
 {
     $resultSet = new \Zend\Db\ResultSet\ResultSet();
     $resultSet->initialize(array(array('Name' => 'RegValue')));
     $this->_registryManager = $this->createMock('Model\\Registry\\RegistryManager');
     $this->_registryManager->expects($this->once())->method('getValueDefinitions')->willReturn($resultSet);
     $this->_customFieldManager = $this->createMock('Model\\Client\\CustomFieldManager');
     $this->_customFieldManager->expects($this->once())->method('getFields')->will($this->returnValue(array('TAG' => 'text', 'Clob' => 'clob', 'Integer' => 'integer', 'Float' => 'float', 'Date' => 'date')));
     parent::setUp();
 }
 /**
  * Delete a custom field definition
  *
  * URL parameter: 'name'
  * @return array|\Zend\Http\Response array(field) or redirect response
  */
 public function deletefieldAction()
 {
     $field = $this->params()->fromQuery('name');
     if ($this->getRequest()->isPost()) {
         if ($this->params()->fromPost('yes')) {
             $this->_customFieldManager->deleteField($field);
         }
         return $this->redirectToRoute('preferences', 'customfields');
     } else {
         return array('field' => $field);
     }
 }
 public function setUp()
 {
     $this->_customFieldManager = $this->getMockBuilder('Model\\Client\\CustomFieldManager')->disableOriginalConstructor()->getMock();
     $this->_customFieldManager->expects($this->once())->method('getFields')->willReturn(array('TAG' => 'text', 'Clob' => 'clob', 'Integer' => 'integer', 'Float' => 'float', 'Date' => 'date'));
     parent::setUp();
 }
 public function setUp()
 {
     $this->_customFieldManager = $this->createMock('Model\\Client\\CustomFieldManager');
     $this->_customFieldManager->expects($this->once())->method('getFields')->willReturn(array('TAG' => 'text', 'Clob' => 'clob', 'Integer' => 'integer', 'Float' => 'float', 'Date' => 'date'));
     parent::setUp();
 }
 public function testDeletefieldActionPostYes()
 {
     $this->_customFieldManager->expects($this->once())->method('deleteField')->with('Name');
     $this->dispatch('/console/preferences/deletefield/?name=Name', 'POST', array('yes' => 'Yes'));
     $this->assertRedirectTo('/console/preferences/customfields/');
 }