function WorkbenchSchedulerScheduleTestCase::testScheduleCreate in Workbench Scheduler 7.2
Same name and namespace in other branches
- 7 tests/workbench_scheduler.test \WorkbenchSchedulerScheduleTestCase::testScheduleCreate()
File
- tests/
workbench_scheduler.test, line 55 - Tests for workbench_scheduler.module.
Class
- WorkbenchSchedulerScheduleTestCase
- Create Schedule.
Code
function testScheduleCreate() {
// Create schedule.
$edit = array();
$edit['label'] = $this
->randomName(8);
$edit['name'] = strtolower($this
->randomName(8));
$edit['transition'] = 1;
// $edit['#schedule'] = new stdClass;
$edit["types[{$this->content_type}]"] = $this->content_type;
$this
->drupalPost('admin/config/workbench/scheduler/schedules/add', $edit, t('Save'));
// Checking database integrity to see if it was created successfully.
$query = db_select('workbench_scheduler_schedules', 'wss')
->fields('wss')
->condition('wss.name', $edit['name'], '=')
->condition('wss.label', $edit['label'], '=')
->condition('wss.transition', $edit['transition'], '=')
->range(0, 1);
// Checking table relationships.
$query
->join('workbench_scheduler_types', 'wst', "wss.name = wst.name AND wst.type ='{$this->content_type}'");
$query
->execute();
$this
->assertTrue($query, 'Workbench Schedule saved');
}