You are here

public function RabbitHoleBehaviorSettingsFormTestBase::testBundleFormFirstSave in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php \Drupal\Tests\rabbit_hole\Functional\RabbitHoleBehaviorSettingsFormTestBase::testBundleFormFirstSave()

Test the first bundle form save with Rabbit Hole configuration.

1 call to RabbitHoleBehaviorSettingsFormTestBase::testBundleFormFirstSave()
NodeBehaviorSettingsFormTest::testBundleEditWithFieldUi in modules/rh_node/tests/src/Functional/NodeBehaviorSettingsFormTest.php
Test that Rabbit Hole settings are created with "Field UI" enabled.

File

tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php, line 105

Class

RabbitHoleBehaviorSettingsFormTestBase
Base class for the Rabbit Hole form additions tests.

Namespace

Drupal\Tests\rabbit_hole\Functional

Code

public function testBundleFormFirstSave() {
  $test_bundle_id = $this
    ->createEntityBundle();
  $this
    ->loadEntityBundleForm($test_bundle_id);
  $override = BehaviorSettings::OVERRIDE_DISALLOW;
  $action = 'access_denied';
  $this
    ->submitForm([
    'rh_override' => $override,
    'rh_action' => $action,
  ], 'edit-submit');
  $saved_config = $this->behaviorSettingsManager
    ->loadBehaviorSettingsAsConfig($this->bundleEntityTypeName, $test_bundle_id);
  $this
    ->assertEquals($action, $saved_config
    ->get('action'));
  $this
    ->assertEquals($override, $saved_config
    ->get('allow_override'));
}