You are here

public function TestNotifyPeriods::testPeriodNextCronLastYd in Notify 7

File

./notify.test, line 617
Automated tests for notify.

Class

TestNotifyPeriods

Code

public function testPeriodNextCronLastYd() {

  // Set up notify environment.
  variable_set('notify_attempts', 1);
  variable_set('notify_include_updates', 0);
  variable_set('notify_reg_default', 1);
  variable_set('notify_period', 0);
  variable_set('notify_send_hour', 9);
  variable_set('notify_batchsize', 100);
  $yd = REQUEST_TIME - 86400;
  variable_set('notify_send_start', 0);

  // We haven't started
  variable_set('notify_send_last', $yd);

  // Last reset
  variable_set('notify_cron_next', 0);

  // Cron reset
  $this
    ->createContent(3);
  $this
    ->cronRun();
  $mails = $this
    ->drupalGetMails();
  $howmany = count($mails);
  $this
    ->assertEqual($howmany, 3, 'Three emails are sent.');
}