public function tearDown() { if (!empty($this->id)) { $job = new SchedulersJob(); $job->mark_deleted($this->id); } SugarTestHelper::tearDown(); }
/** * Delete a job * @param string $jobId */ public function deleteJob($jobId) { $job = new SchedulersJob(); if (empty($job)) { return false; } return $job->mark_deleted($jobId); }
public function testrunJob() { //test without a valid user $schedulersJob = new SchedulersJob(); $schedulersJob->target = 'function::processAOW_Workflow'; $result = $schedulersJob->runJob(); $this->assertEquals(false, $result); $schedulersJob->mark_deleted($schedulersJob->id); //test with valid user $schedulersJob = new SchedulersJob(); $schedulersJob->assigned_user_id = 1; $schedulersJob->target = 'function::processAOW_Workflow'; $result = $schedulersJob->runJob(); $this->assertEquals(true, $result); $schedulersJob->mark_deleted($schedulersJob->id); //test with valid user $schedulersJob = new SchedulersJob(); $schedulersJob->assigned_user_id = 1; $schedulersJob->target = 'url::https://suitecrm.com/'; $result = $schedulersJob->runJob(); $this->assertEquals(true, $result); $schedulersJob->mark_deleted($schedulersJob->id); }