You are here

protected function EntityManagerTest::getContentHubEntityTypeConfigEntity in Acquia Content Hub 8

Builds a ContentHubEntityTypeConfig entity.

Parameters

string $id: The Configuration entity ID.

Return value

\Drupal\acquia_contenthub\Entity\ContentHubEntityTypeConfig The Configuration entity.

1 call to EntityManagerTest::getContentHubEntityTypeConfigEntity()
EntityManagerTest::getContentHubConfigStorage in tests/src/Unit/EntityManagerTest.php
Defines the Content Hub Entity Types Configuration.

File

tests/src/Unit/EntityManagerTest.php, line 151

Class

EntityManagerTest
PHPUnit for the EntityManager class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

protected function getContentHubEntityTypeConfigEntity($id) {
  $bundles = [
    'entity_type_1' => [
      'bundle_11' => [
        'enable_index' => 1,
        'enable_viewmodes' => 1,
        'rendering' => [
          'view_1',
          'view_2',
          'view_3',
        ],
      ],
    ],
    'entity_type_2' => [
      'bundle_21' => [
        'enable_index' => 1,
        'enable_viewmodes' => 0,
        'rendering' => [],
      ],
      'bundle_22' => [
        'enable_index' => 0,
        'enable_viewmodes' => 0,
        'rendering' => [
          'view_4',
        ],
      ],
      'bundle_23' => [
        'enable_index' => 1,
        'enable_viewmodes' => 1,
        'rendering' => [],
      ],
    ],
    'entity_type_3' => [
      'bundle_31' => [
        'enable_index' => 0,
        'enable_viewmodes' => 0,
        'rendering' => [],
      ],
    ],
  ];
  $values = [
    'id' => $id,
  ];
  $config_entity = new ContentHubEntityTypeConfig($values, 'acquia_contenthub_entity_config');
  $config_entity
    ->setBundles($bundles[$id]);
  return $config_entity;
}