예제 #1
0
 public function tearDown()
 {
     if (!empty($this->id)) {
         $job = new SchedulersJob();
         $job->mark_deleted($this->id);
     }
     SugarTestHelper::tearDown();
 }
예제 #2
0
 /**
  * Delete a job
  * @param string $jobId
  */
 public function deleteJob($jobId)
 {
     $job = new SchedulersJob();
     if (empty($job)) {
         return false;
     }
     return $job->mark_deleted($jobId);
 }
예제 #3
0
 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);
 }