public function RestfulCsrfTokenTestCase::testCsrfTokenAnon in RESTful 7.2
Same name and namespace in other branches
- 7 tests/RestfulCsrfTokenTestCase.test \RestfulCsrfTokenTestCase::testCsrfTokenAnon()
Test the validation of a CSRF token for anonymous users.
File
- tests/
RestfulCsrfTokenTestCase.test, line 74 - Contains RestfulCsrfTokenTestCase
Class
Code
public function testCsrfTokenAnon() {
global $user;
$user = drupal_anonymous_user();
// Allow anonymous user to CRUD article content.
$permissions = array(
'create article content' => TRUE,
'edit any article content' => TRUE,
'delete any article content' => TRUE,
);
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, $permissions);
$this
->checkCsrfRequest($this->writeOperations, FALSE, FALSE);
}