You are here

public function BundleCRUDTest::singleBundleEditWithOverrides in Entity Construction Kit (ECK) 8

Tests single bundle edit with title overrides.

@test

Throws

\Behat\Mink\Exception\ExpectationException

File

tests/src/Functional/BundleCRUDTest.php, line 49

Class

BundleCRUDTest
Tests eck's bundle creation, update and deletion.

Namespace

Drupal\Tests\eck\Functional

Code

public function singleBundleEditWithOverrides() {
  $entityTypeInfo = $this
    ->createEntityType();
  $title_overrides = [];
  foreach ($this
    ->getConfigurableBaseFields() as $field) {
    $title_overrides[$field] = $this
      ->randomMachineName(16);
  }
  $bundle_info = $this
    ->createEntityBundle($entityTypeInfo['id'], '', $title_overrides);
  $new_title_overrides = [];
  foreach ($this
    ->getConfigurableBaseFields() as $field) {
    $new_title_overrides[$field] = $this
      ->randomMachineName(16);
  }
  $this
    ->editEntityBundle($entityTypeInfo['id'], $bundle_info['type'], $this
    ->randomMachineName(16), $new_title_overrides);
}