Example #1
0
 public function save()
 {
     $this->load->model('Data_handler');
     $people = $this->input->post('people');
     $dh = new Data_handler();
     $dh->save($people);
     redirect('people?save=true');
 }
Example #2
0
 public function index()
 {
     $this->load->library('unit_test');
     $this->load->model('Data_handler');
     $dh = new Data_handler();
     $people = array();
     $people[] = array('firstname' => 'Mick', 'surname' => 'Jagger');
     $people[] = array('firstname' => 'Keith', 'surname' => 'Richards');
     $people[] = array('firstname' => 'Charlie', 'surname' => 'Watts');
     $dh->save($people);
     $retrieved = $dh->load();
     $test_name = "Data storage and retrieval";
     $test_notes = "An array of people is tested against the same array that has been saved to and retrieved from disk.";
     $this->unit->run($retrieved, $people, $test_name, $test_notes);
     $this->load->view('header');
     $this->load->view('tests/index');
     $this->load->view('footer');
 }