I'm building out my module using SimpleTest and need to write a test to verify that access to a menu path is correctly restricted. Based on the Lullabot tutorial, I'm figuring the correct method is to create a user without the necessary permissions, log in, call the get() method, and test the returned text for Access Denied. Something like ..
function testAdminAccess() {
$user = drupalCreateUserRolePerm();
$this->drupalLoginUser($user);
$url = url("admin/settings/post_reminder", array('absolute' => TRUE));
$contents = $this->get($url);
$this->assertNoText($contents, t('Access Denied'));
}
?>
Is this the way or is there a better means; maybe something that can test the html code returned? I've been looking in the API function reference in the handbook, but it doesn't appear to contain all the available methods.
Many thanks,
Barrett









