protected function GroupBehaviorSettingsFormTest::createEntityBundleFormSubmit in Rabbit Hole 2.x
Same name and namespace in other branches
- 8 modules/rh_group/tests/src/Functional/GroupBehaviorSettingsFormTest.php \Drupal\Tests\rh_group\Functional\GroupBehaviorSettingsFormTest::createEntityBundleFormSubmit()
Creates new entity bundle via form submit.
Overrides RabbitHoleBehaviorSettingsFormTestBase::createEntityBundleFormSubmit
File
- modules/
rh_group/ tests/ src/ Functional/ GroupBehaviorSettingsFormTest.php, line 57
Class
- GroupBehaviorSettingsFormTest
- Test the functionality of the rabbit hole form additions to the Group.
Namespace
Drupal\Tests\rh_group\FunctionalCode
protected function createEntityBundleFormSubmit($action, $override) {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('/admin/group/types/add');
$this
->assertSession()
->statusCodeEquals(200);
$submit_button = 'Save group type';
$this
->assertSession()
->buttonExists($submit_button);
$this
->assertRabbitHoleSettings();
$edit = [
'label' => $this
->randomString(),
'id' => mb_strtolower($this
->randomMachineName()),
'rh_action' => $action,
'rh_override' => $override,
];
$this
->submitForm($edit, $submit_button);
$this->bundle = $this
->loadBundle($edit['id']);
return $edit['id'];
}