You are here

public function SchedulerFunctionalTest::testBasicScheduling in Scheduler 7

Tests basic scheduling of content.

Parameters

bool $scheduler_cron_only: TRUE to only run Scheduler cron, FALSE to run default full Drupal cron.

1 call to SchedulerFunctionalTest::testBasicScheduling()
SchedulerFunctionalTest::testBasicSchedulingWithOnlySchedulerCron in tests/scheduler.test
Tests scheduler when not all cron tasks are run during cron.

File

tests/scheduler.test, line 217
Scheduler module test case file.

Class

SchedulerFunctionalTest
Tests the scheduler interface.

Code

public function testBasicScheduling($scheduler_cron_only = FALSE) {

  // Create node values. Set time to one hour in the future.
  $edit = array(
    'publish_on' => format_date(time() + 3600, 'custom', 'Y-m-d H:i:s'),
    'status' => 1,
    'promote' => 1,
  );

  // Test scheduled publishing.
  $this
    ->helpTestScheduler($edit, $scheduler_cron_only);

  // Test scheduled unpublishing.
  $edit['unpublish_on'] = $edit['publish_on'];
  unset($edit['publish_on']);
  $this
    ->helpTestScheduler($edit, $scheduler_cron_only);
}