public function RabbitHoleBehaviorSettingsFormTestBase::testBundleCreation in Rabbit Hole 8
Same name and namespace in other branches
- 2.x tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php \Drupal\Tests\rabbit_hole\Functional\RabbitHoleBehaviorSettingsFormTestBase::testBundleCreation()
Test that Rabbit Hole settings are created together with entity bundle.
1 call to RabbitHoleBehaviorSettingsFormTestBase::testBundleCreation()
- NodeBehaviorSettingsFormTest::testBundleCreationWithFieldUi in modules/
rh_node/ tests/ src/ Functional/ NodeBehaviorSettingsFormTest.php - Test that Rabbit Hole settings are created with "Field UI" enabled.
1 method overrides RabbitHoleBehaviorSettingsFormTestBase::testBundleCreation()
- UserBehaviorSettingsFormTest::testBundleCreation in modules/
rh_user/ tests/ src/ Functional/ UserBehaviorSettingsFormTest.php - Nothing to test here, user entity/bundle already exists.
File
- tests/
src/ Functional/ RabbitHoleBehaviorSettingsFormTestBase.php, line 88
Class
- RabbitHoleBehaviorSettingsFormTestBase
- Base class for the Rabbit Hole form additions tests.
Namespace
Drupal\Tests\rabbit_hole\FunctionalCode
public function testBundleCreation() {
$override = BehaviorSettings::OVERRIDE_DISALLOW;
$action = 'access_denied';
$bundle_id = $this
->createEntityBundleFormSubmit($action, $override);
$saved_config = $this->behaviorSettingsManager
->loadBehaviorSettingsAsConfig($this->bundleEntityTypeName, $bundle_id);
$this
->assertEquals($action, $saved_config
->get('action'));
$this
->assertEquals($override, $saved_config
->get('allow_override'));
$this
->loadEntityBundleForm($bundle_id);
$this
->assertSession()
->fieldValueEquals('rh_override', $override);
$this
->assertSession()
->checkboxChecked($this
->getOptionId($action));
}