You are here

function UserAccessTest::_addMask in SimpleTest 5

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

File

tests/user_access.test, line 21

Class

UserAccessTest

Code

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