You are here

function WorkbenchAccessTestCase::assertWorkbenchScheme in Workbench Access 7

Any tests that can be abstracted should go here in a new method.

3 calls to WorkbenchAccessTestCase::assertWorkbenchScheme()
WorkbenchAccessMenuTestCase::testWorkbenchAccessMenu in tests/workbench_access.test
WorkbenchAccessRoleTestCase::testWorkbenchAccessRoles in tests/workbench_access.test
WorkbenchAccessTaxonomyTestCase::testWorkbenchAccessTaxonomy in tests/workbench_access.test

File

tests/workbench_access.test, line 125
Test file for Workbench Access.

Class

WorkbenchAccessTestCase
@file Test file for Workbench Access.

Code

function assertWorkbenchScheme($scheme, $root = 'workbench_access') {
  workbench_access_reset_tree();
  $active = workbench_access_get_active_tree();
  $this
    ->assertTrue(!empty($active['access_scheme']), t('Active access scheme set.'));
  $this
    ->assertTrue(!empty($active['tree']), t('Active access tree set.'));
  $this
    ->assertTrue(!empty($active['active']), t('Active access sections set.'));
  $this
    ->assertTrue($active['access_scheme']['access_scheme'] == $scheme, t('Using %scheme access scheme.', array(
    '%scheme' => $scheme,
  )));
  $this
    ->assertTrue(in_array($root, $active['access_scheme']['access_type_id']), t('Using Workbench Access test scheme.'));
  $this
    ->assertTrue(isset($active['tree'][$root]), t('Tree returned correctly.'));
}