public function MetatagTestBase::createUser in 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/
MetatagTestBase.test, line 130 - A base class for the Metatag tests, provides shared methods.
Class
- MetatagTestBase
- A base class for the Metatag tests, provides shared methods.
Code
public function createUser(array $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));
}