function SchemaMetatagTestHelper::createUser in Schema.org Metatag 7
Create a normal user for the tests.
Parameters
array $extra_permissions: An array of permission strings to be added to the user.
Return value
object A user object.
File
- tests/
schema_metatag.helper.test, line 87
Class
- SchemaMetatagTestHelper
- A base class for the Metatag tests, provides shared methods.
Code
function createUser($extra_permissions) {
// Basic permissions for the module.
$permissions = array(
'edit meta tags',
);
// Reset the static variable used to identify permissions, otherwise it's
// possible the permissions check in drupalCreateUser will fail.
$this
->checkPermissions(array(), TRUE);
cache_clear_all();
return $this
->drupalCreateUser(array_merge($permissions, $extra_permissions));
}