PMA\libraries\config\FormDisplay::process PHP Method

process() public method

Processes forms, returns true on successful save
public process ( boolean $allow_partial_save = true, boolean $check_form_submit = true ) : boolean
$allow_partial_save boolean allows for partial form saving on failed validation
$check_form_submit boolean whether check for $_POST['submit_save']
return boolean whether processing was successful
    public function process($allow_partial_save = true, $check_form_submit = true)
    {
        if ($check_form_submit && !isset($_POST['submit_save'])) {
            return false;
        }
        // save forms
        if (count($this->_forms) > 0) {
            return $this->save(array_keys($this->_forms), $allow_partial_save);
        }
        return false;
    }

Usage Example

 /**
  * Test for FormDisplay::process
  *
  * @return void
  * @group medium
  */
 public function testProcess()
 {
     $this->assertFalse($this->object->process(true, true));
     $this->object = $this->getMockBuilder('PMA\\libraries\\config\\FormDisplay')->disableOriginalConstructor()->setMethods(array('save'))->getMock();
     $attrForms = new \ReflectionProperty('PMA\\libraries\\config\\FormDisplay', '_forms');
     $attrForms->setAccessible(true);
     $attrForms->setValue($this->object, array(1, 2, 3));
     $this->object->expects($this->once())->method('save')->with(array(0, 1, 2), false)->will($this->returnValue(true));
     $this->assertTrue($this->object->process(false, false));
     $attrForms->setValue($this->object, array());
     $this->assertFalse($this->object->process(false, false));
 }
All Usage Examples Of PMA\libraries\config\FormDisplay::process