You are here

protected function WorkbenchWorkflowsTestCase::testInstallOfExportables in Workbench Moderation 7.2

Tests the upgrade routines (outside of the user interface).

File

modules/workbench_workflows/tests/workbench_workflows.test, line 29
Provides tests.

Class

WorkbenchWorkflowsTestCase
Tests for Workbench Workflows

Code

protected function testInstallOfExportables() {

  // These are the machine names and labels of the expected starter
  // states, events, and workflows.
  $exportables = array(
    'states' => array(
      'draft' => 'Draft',
      'needs_review' => 'Needs Review',
      'published' => 'Published',
    ),
    'events' => array(
      'draft' => 'Draft',
      'needs_review' => 'Needs Review',
      'published' => 'Published',
    ),
    'workflows' => array(
      'default_workflow' => 'Default Workflow',
    ),
  );
  foreach ($exportables as $exportable_type => $set_of_exportables) {
    foreach ($set_of_exportables as $exportable_machine_name => $exportable_admin_title) {
      $loaded_exportable = workbench_workflows_load($exportable_type, $exportable_machine_name);
      $this
        ->assertEqual($loaded_exportable->admin_title, $exportable_admin_title, 'Loading ' . $exportable_type . ': ' . $exportable_machine_name . ' was loaded.');
    }
  }
}