Esempio n. 1
0
 /**
  * Validate scheduled tasks.
  */
 public function test_elis_tasks_get_cached()
 {
     $dataset = $this->createCsvDataSet(array('local_eliscore_sched_tasks' => elis::component_file('eliscore', 'tests/fixtures/elis_scheduled_tasks.csv')));
     $this->loadDataSet($dataset);
     $cachedtasks = elis_tasks_get_cached('elis_program');
     $this->assertNotEmpty($cachedtasks);
     $this->assertInternalType('array', $cachedtasks);
     $this->assertArrayHasKey('s:7:"pm_cron";', $cachedtasks);
     $this->assertNotEmpty($cachedtasks['s:7:"pm_cron";']);
     $this->assertInternalType('array', $cachedtasks['s:7:"pm_cron";']);
 }
Esempio n. 2
0
/**
 * Remove all tasks
 * @param $component - examples: 'moodle', 'mod/forum', 'block/quiz_results'
 */
function elis_tasks_uninstall($component)
{
    $cachedtasks = elis_tasks_get_cached($component);
    elis_tasks_cleanup($component, $cachedtasks);
}