public function NodeApiExampleTestCase::setUp in Examples for Developers 7
Same name and namespace in other branches
- 6 nodeapi_example/nodeapi_example.test \NodeApiExampleTestCase::setUp()
Enables modules and create user with specific permissions.
Overrides DrupalWebTestCase::setUp
File
- nodeapi_example/
nodeapi_example.test, line 43 - Test case for Testing the node API example module.
Class
- NodeApiExampleTestCase
- Functional tests for the NodeAPI Example module.
Code
public function setUp() {
parent::setUp('nodeapi_example');
// Create admin user. This module has no access control, so we can use a
// trusted user. Revision access and revert permissions are required too.
$this->webUser = $this
->drupalCreateUser(array(
// Required to set revision checkbox.
'administer nodes',
'administer content types',
'bypass node access',
'view revisions',
'revert revisions',
));
// Login the admin user.
$this
->drupalLogin($this->webUser);
}