Wanting to test that only users with "access content" have access:
public function testOnlyAccessContentAccessible() {
$web_user = $this->drupalCreateUser();
$this->drupalLogin($web_user);
$this->drupalGet("foo");
$this->assertResponse(403);
}
The module under test, relevant hook_menu
-entry:
$items['foo'] = array(
'title' => 'Foo',
'page callback' => 'foo',
'access arguments' => array("access content"),
'expanded' => TRUE,
);
What is wrong here? My drupalCreateUser
has not recieved an array with permissions, so it did not receive the "access content" permission either; yet Drupal hands out this permission by default, so I guess this is a permission that is "default" when nothing is posted.
So, how to check that only users with permission "access content" can access a page?