You are here

function WorkbenchAccessBaseTestCase::testWorkbenchAccessInstall in Workbench Access 7

File

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

Class

WorkbenchAccessBaseTestCase

Code

function testWorkbenchAccessInstall() {

  // Create some nodes and users.
  $this
    ->createWorkbenchAccessNodes();
  $this
    ->createWorkbenchAccessUsers();

  // Check for user creation.
  $this
    ->assertTrue(count($this->user_list) == 10, t('Ten new users were created.'));
  $this
    ->assertTrue(!empty($this->editor_role), t('Created editor role.'));

  // Check for node creation.
  $count = db_query("SELECT COUNT(n.nid) FROM {node} n")
    ->fetchField();
  $this
    ->assertTrue($count == 10, t('Ten initial nodes created.'));
  $nid = db_query_range("SELECT n.nid FROM {node} n INNER JOIN {workbench_access_node} wan ON n.nid = wan.nid", 0, 1)
    ->fetchField();
  $this
    ->assertTrue(empty($nid), t('Initial nodes have no access data.'));
}