You are here

function UserAccessTest::_addMask in SimpleTest 6

Same name and namespace in other branches
  1. 5 tests/user_access.test \UserAccessTest::_addMask()
1 call to UserAccessTest::_addMask()
UserAccessTest::testAccess in tests/user_module.test

File

tests/user_module.test, line 166

Class

UserAccessTest

Code

function _addMask($mask, $type, $status = 0) {
  db_query("INSERT INTO {access} (mask, type, status) VALUES ('%s', '%s', %d)", $mask, $type, $status);
  $aid = db_last_insert_id('access', 'aid');
  $str_status = $status == 0 ? 'deny' : 'allow';
  $this
    ->assertTrue(db_affected_rows() > 0, "{$str_status} Mask added for {$type} '{$mask}'");
  $this->_cleanup_masks[] = $aid;
}