You are here

protected function BundleFormAlterTest::assertTargetBundles in Organic groups 8

Checks whether the target bundles in the group content are as expected.

Parameters

array|null $expected: The expected value for the target bundles.

string $message: The message to display with the assertion.

1 call to BundleFormAlterTest::assertTargetBundles()
BundleFormAlterTest::testCreate in og_ui/tests/src/Functional/BundleFormAlterTest.php
Test that group and group content bundles can be created through the UI.

File

og_ui/tests/src/Functional/BundleFormAlterTest.php, line 138

Class

BundleFormAlterTest
Test making a bundle a group and a group content.

Namespace

Drupal\Tests\og_ui\Functional

Code

protected function assertTargetBundles($expected, $message) {

  /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager */
  $entity_field_manager = $this->container
    ->get('entity_field.manager');
  $entity_field_manager
    ->clearCachedFieldDefinitions();
  $field_definitions = $entity_field_manager
    ->getFieldDefinitions('node', 'class');
  $settings = $field_definitions['og_audience']
    ->getSetting('handler_settings');
  $this
    ->assertEquals($expected, $settings['target_bundles'], $message);
}