You are here

public function MetatagTestBase::createAdminUser in Metatag 7

Create an admin 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.

27 calls to MetatagTestBase::createAdminUser()
MetatagBulkRevertTest::testBulkRevertPageLoads in tests/MetatagBulkRevertTest.test
Test the Bulk Revert functionality works.
MetatagContextTest::setUp in metatag_context/tests/MetatagContextTest.test
Sets up a Drupal site for running functional and integration tests.
MetatagContextWithI18nTest::setUp in metatag_context/tests/MetatagContextWithI18nTest.test
Sets up a Drupal site for running functional and integration tests.
MetatagCoreLocaleTest::testNodeFormTranslations in tests/MetatagCoreLocaleTest.test
Test that the node form meta tag fields are translated correctly.
MetatagCoreNodeTest::checkNodePreviewOption in tests/MetatagCoreNodeTest.test
Change the node preview option at the content type level.

... See full list

File

tests/MetatagTestBase.test, line 103
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 createAdminUser(array $extra_permissions = array()) {
  $permissions = array(
    // Basic permissions for the module.
    'administer meta tags',
    'edit meta tags',
    // General admin access.
    'access administration pages',
  );

  // 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));
}