You are here

private function ForumAccessTestCase::testForumAccessGetForumGrants in Forum Access 6

This function gets the forum grants from the database

1 call to ForumAccessTestCase::testForumAccessGetForumGrants()
ForumAccessTestCase::testForumAccessDumpDebugInfo in ./forum_access.test
This function is called when the program detects an error. It gives extra information so that the error can be fixed. hopefully :)

File

./forum_access.test, line 1371
Test file for forum_access.module.

Class

ForumAccessTestCase
This is the base class for forum access testing.

Code

private function testForumAccessGetForumGrants() {
  $grants = array();
  $grants_anonymous = db_fetch_object(db_query("SELECT * FROM {forum_access} WHERE rid = %d", DRUPAL_ANONYMOUS_RID));
  $grants['anonymous_view'] = $grants_anonymous->grant_view ? TRUE : FALSE;
  $grants['anonymous_create'] = $grants_anonymous->grant_create ? TRUE : FALSE;
  $grants['anonymous_update'] = $grants_anonymous->grant_update ? TRUE : FALSE;
  $grants['anonymous_delete'] = $grants_anonymous->grant_delete ? TRUE : FALSE;
  $grants_authenticated = db_fetch_object(db_query("SELECT * FROM {forum_access} WHERE rid = %d", DRUPAL_AUTHENTICATED_RID));
  $grants['authenticated_view'] = $grants_authenticated->grant_view ? TRUE : FALSE;
  $grants['authenticated_create'] = $grants_authenticated->grant_create ? TRUE : FALSE;
  $grants['authenticated_update'] = $grants_authenticated->grant_update ? TRUE : FALSE;
  $grants['authenticated_delete'] = $grants_authenticated->grant_delete ? TRUE : FALSE;
  return $grants;
}