protected function ForwardRevisionNodeValidationTest::setUp in Entity Reference Hierarchy 8.2
Same name and namespace in other branches
- 3.x tests/src/Functional/ForwardRevisionNodeValidationTest.php \Drupal\Tests\entity_hierarchy\Functional\ForwardRevisionNodeValidationTest::setUp()
Overrides BrowserTestBase::setUp
File
- tests/
src/ Functional/ ForwardRevisionNodeValidationTest.php, line 48
Class
- ForwardRevisionNodeValidationTest
- Defines a class for testing the warnings on delete form.
Namespace
Drupal\Tests\entity_hierarchy\FunctionalCode
protected function setUp() {
parent::setUp();
$content_type = $this
->createContentType([
'type' => 'article',
'new_revision' => 1,
]);
$content_type
->setThirdPartySetting('workbench_moderation', 'enabled', TRUE);
$content_type
->setThirdPartySetting('workbench_moderation', 'allowed_moderation_states', array_keys(ModerationState::loadMultiple()));
$content_type
->save();
$this
->setupEntityHierarchyField(static::ENTITY_TYPE, 'article', static::FIELD_NAME);
$this
->getEntityFormDisplay(self::ENTITY_TYPE, 'article', 'default')
->setComponent(self::FIELD_NAME, [
'type' => 'entity_reference_hierarchy_autocomplete',
'weight' => 20,
'settings' => [
'hide_weight' => TRUE,
] + EntityReferenceHierarchyAutocomplete::defaultSettings(),
])
->save();
$this
->additionalSetup();
}