You are here

protected function EntityUpdateTest::setUp in Drupal 10

File

core/modules/editor/tests/src/Kernel/EntityUpdateTest.php, line 26

Class

EntityUpdateTest
Tests updating an entity.

Namespace

Drupal\Tests\editor\Kernel

Code

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);
}