public function testsave_lines() { error_reporting(E_ERROR | E_PARSE); $aor_Field = new AOR_Field(); //preset the required data $post_data = array(); $post_data['field'][] = 'test field'; $post_data['name'][] = 'test'; $post_data['module_path'][] = 'test path'; $post_data['display'][] = '1'; $post_data['link'][] = '1'; $post_data['label'][] = 'test label'; $post_data['field_function'][] = 'test function'; $post_data['total'][] = 'total'; $post_data['group_by'][] = '1'; $post_data['group_order'][] = 'desc'; $post_data['group_display'][] = '1'; //execute the method and test if it works and does not throws an exception. try { $aor_Field->save_lines($post_data, new AOR_Report()); $this->assertTrue(true); } catch (Exception $e) { $this->fail(); } }
function save($check_notify = FALSE) { if (empty($this->id)) { unset($_POST['aor_conditions_id']); unset($_POST['aor_fields_id']); } parent::save($check_notify); require_once 'modules/AOR_Fields/AOR_Field.php'; $condition = new AOR_Field(); $condition->save_lines($_POST, $this, 'aor_fields_'); require_once 'modules/AOR_Conditions/AOR_Condition.php'; $condition = new AOR_Condition(); $condition->save_lines($_POST, $this, 'aor_conditions_'); }
function save($check_notify = FALSE) { // TODO: process of saveing the fields and conditions is too long so we will have to make some optimization on save_lines functions set_time_limit(3600); if (empty($this->id)) { unset($_POST['aor_conditions_id']); unset($_POST['aor_fields_id']); } parent::save($check_notify); require_once 'modules/AOR_Fields/AOR_Field.php'; $field = new AOR_Field(); $field->save_lines($_POST, $this, 'aor_fields_'); require_once 'modules/AOR_Conditions/AOR_Condition.php'; $condition = new AOR_Condition(); $condition->save_lines($_POST, $this, 'aor_conditions_'); require_once 'modules/AOR_Charts/AOR_Chart.php'; $chart = new AOR_Chart(); $chart->save_lines($_POST, $this, 'aor_chart_'); }