You are here

protected function TaxonomyBehaviorSettingsFormTest::createEntityBundleFormSubmit in Rabbit Hole 2.x

Same name and namespace in other branches
  1. 8 modules/rh_taxonomy/tests/src/Functional/TaxonomyBehaviorSettingsFormTest.php \Drupal\Tests\rh_taxonomy\Functional\TaxonomyBehaviorSettingsFormTest::createEntityBundleFormSubmit()

Creates new entity bundle via form submit.

Overrides RabbitHoleBehaviorSettingsFormTestBase::createEntityBundleFormSubmit

File

modules/rh_taxonomy/tests/src/Functional/TaxonomyBehaviorSettingsFormTest.php, line 51

Class

TaxonomyBehaviorSettingsFormTest
Test the functionality of the rabbit hole form additions to the taxonomy.

Namespace

Drupal\Tests\rh_taxonomy\Functional

Code

protected function createEntityBundleFormSubmit($action, $override) {
  $this
    ->drupalLogin($this->adminUser);
  $edit = [
    'name' => $this
      ->randomString(),
    'vid' => mb_strtolower($this
      ->randomMachineName()),
    'rh_action' => $action,
    'rh_override' => $override,
  ];
  $this
    ->drupalGet('/admin/structure/taxonomy/add');
  $this
    ->assertRabbitHoleSettings();
  $this
    ->submitForm($edit, 'Save');
  $this->bundle = $this
    ->loadBundle($edit['vid']);
  return $edit['vid'];
}