You are here

public function RabbitHoleBehaviorSettingsFormTestBase::testBundleFormExistingBehavior in Rabbit Hole 2.x

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

Test that bundle form with a configured bundle behaviour loads config.

File

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

Class

RabbitHoleBehaviorSettingsFormTestBase
Base class for the Rabbit Hole form additions tests.

Namespace

Drupal\Tests\rabbit_hole\Functional

Code

public function testBundleFormExistingBehavior() {
  $action = 'page_not_found';
  $override = BehaviorSettings::OVERRIDE_DISALLOW;
  $test_bundle_id = $this
    ->createEntityBundle();
  $this->behaviorSettingsManager
    ->saveBehaviorSettings([
    'action' => $action,
    'allow_override' => $override,
    'redirect_code' => BehaviorSettings::REDIRECT_NOT_APPLICABLE,
  ], $this->bundleEntityTypeName, $test_bundle_id);
  $this
    ->loadEntityBundleForm($test_bundle_id);
  $this
    ->assertSession()
    ->fieldValueEquals('rh_override', $override);
  $this
    ->assertSession()
    ->checkboxChecked($this
    ->getOptionId($action));
}