コード例 #1
0
 /**
  * Run a series of cron jobs and make an assertion about email deliveries.
  *
  * @param array $cronRuns
  *   array specifying when to run cron and what messages to expect; each item is an array with keys:
  *   - time: string, e.g. '2012-06-15 21:00:01'
  *   - recipients: array(array(string)), list of email addresses which should receive messages
  */
 public function assertCronRuns($cronRuns)
 {
     foreach ($cronRuns as $cronRun) {
         CRM_Utils_Time::setTime($cronRun['time']);
         $this->callAPISuccess('job', 'send_reminder', array());
         $this->mut->assertRecipients($cronRun['recipients']);
         if (array_key_exists('subjects', $cronRun)) {
             $this->mut->assertSubjects($cronRun['subjects']);
         }
         $this->mut->clearMessages();
     }
 }