You are here

public function ContentHubTestBase::configureContentHubContentTypes in Acquia Content Hub 8

Configures Content types to be exported to Content Hub.

Parameters

string $entity_type: The entity type the bundles belong to.

array $bundles: The bundles to enable.

8 calls to ContentHubTestBase::configureContentHubContentTypes()
EntityEmbedTest::testEntityEmbedCdf in tests/src/Functional/EntityEmbedTest.php
Tests acquia_contenthub_cdf format for entity_embed entities inside a node.
FieldClearingNodeTest::testFieldClearing in tests/src/Functional/FieldClearingNodeTest.php
Configure content hub node form.
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.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

public function configureContentHubContentTypes($entity_type, array $bundles) {
  $this
    ->drupalGet('admin/config/services/acquia-contenthub/configuration');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $edit = [];
  foreach ($bundles as $bundle) {
    $edit['entities[' . $entity_type . '][' . $bundle . '][enable_index]'] = 1;
  }
  $this
    ->submitForm($edit, $this
    ->t('Save configuration'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/config/services/acquia-contenthub/configuration');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}