You are here

public function ContentHubTestBase::setRoleFor in Acquia Content Hub 8

Sets a role to be used in CDF render.

Parameters

string $role: The role.

5 calls to ContentHubTestBase::setRoleFor()
EntityEmbedTest::testEntityEmbedCdf in tests/src/Functional/EntityEmbedTest.php
Tests acquia_contenthub_cdf format for entity_embed entities inside a node.
FieldPermissionsNodeTest::testFieldPermissions in tests/src/Functional/FieldPermissionsNodeTest.php
Configure content hub node form.
FileImageTest::testFileImage in tests/src/Functional/FileImageTest.php
Tests entity CDFs.
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Acquia Content Hub admin UI.
MediaEntityImageTest::testMediaEntityImage in tests/src/Functional/MediaEntityImageTest.php
Tests a Media entity CDF.

File

tests/src/Functional/ContentHubTestBase.php, line 180

Class

ContentHubTestBase
Provides the base class for web tests for Search API.

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

public function setRoleFor($role) {
  $this
    ->drupalGet('admin/config/services/acquia-contenthub/configuration');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $edit = [
    'user_role' => $role,
  ];
  $this
    ->submitForm($edit, $this
    ->t('Save configuration'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/config/services/acquia-contenthub/configuration');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}