function EntityUpdateTest::setUp
Same name in other branches
- 10 core/modules/editor/tests/src/Kernel/EntityUpdateTest.php \Drupal\Tests\editor\Kernel\EntityUpdateTest::setUp()
- 11.x core/modules/editor/tests/src/Kernel/EntityUpdateTest.php \Drupal\Tests\editor\Kernel\EntityUpdateTest::setUp()
Overrides EntityKernelTestBase::setUp
File
-
core/
modules/ editor/ tests/ src/ Kernel/ EntityUpdateTest.php, line 26
Class
- EntityUpdateTest
- Tests updating an entity.
Namespace
Drupal\Tests\editor\KernelCode
protected function setUp() : void {
parent::setUp();
$this->installSchema('node', [
'node_access',
]);
$this->installConfig([
'node',
]);
// Create a node type for testing.
$type = NodeType::create([
'type' => 'page',
'name' => 'page',
]);
$type->save();
// Set editor_test module weight to be lower than editor module's weight so
// that editor_test_entity_update() is called before editor_entity_update().
$extension_config = \Drupal::configFactory()->get('core.extension');
$editor_module_weight = $extension_config->get('module.editor');
module_set_weight('editor_test', $editor_module_weight - 1);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.