Esempio n. 1
0
 public function test_progress_tracking()
 {
     $this->config->set_finished_task('foo');
     $this->config->set_active_module('bar');
     $this->config->set_task_progress_count(10);
     $this->config->increment_current_task_progress();
     $progress_data = $this->config->get_progress_data();
     $this->assertEquals(1, $progress_data['current_task_progress']);
     $this->config->increment_current_task_progress(2);
     $this->assertEquals(array('last_task_module_name' => 'bar', 'last_task_name' => 'foo', 'max_task_progress' => 10, 'current_task_progress' => 3), $this->config->get_progress_data());
 }
Esempio n. 2
0
 public function test_progress_tracking()
 {
     $this->config->set_finished_task('foo');
     $this->config->set_active_module('bar');
     $this->config->set_task_progress_count(10);
     $this->config->increment_current_task_progress();
     $progress_data = $this->config->get_progress_data();
     $this->assertEquals(1, $progress_data['current_task_progress']);
     $this->config->increment_current_task_progress(2);
     // We only want to check these values
     $result = $this->config->get_progress_data();
     $expected_result = array('last_task_module_name' => 'bar', 'last_task_name' => 'foo', 'max_task_progress' => 10, 'current_task_progress' => 3);
     foreach ($expected_result as $key => $value) {
         $this->assertEquals($value, $result[$key]);
     }
 }
Esempio n. 3
0
 /**
  * Recover install progress
  *
  * @return string	Index of the next installer module to execute
  */
 protected function recover_progress()
 {
     $progress_array = $this->install_config->get_progress_data();
     return $progress_array['last_task_module_index'];
 }