protected function NodeAccessExampleTestCase::checkResponse in Examples for Developers 7
Helper function.
Test if there is access to an $url
Parameters
bool $grant: Access to the $url
string $url: url to make the get call.
Return value
bool Get response
1 call to NodeAccessExampleTestCase::checkResponse()
- NodeAccessExampleTestCase::checkNodeAccess in node_access_example/
node_access_example.test - Helper function.
File
- node_access_example/
node_access_example.test, line 327 - Tests for Node Access example module.
Class
- NodeAccessExampleTestCase
- Functional tests for the Node Access Example module.
Code
protected function checkResponse($grant, $url) {
$this
->drupalGet($url);
if ($grant) {
$response = $this
->assertResponse(200);
}
else {
$response = $this
->assertResponse(403);
}
return $response;
}