function OembedUpdateTest::setUp

Same name and namespace in other branches
  1. 10 core/modules/media/tests/src/Functional/FieldFormatter/OembedUpdateTest.php \Drupal\Tests\media\Functional\FieldFormatter\OembedUpdateTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/media/tests/src/Functional/FieldFormatter/OembedUpdateTest.php, line 22

Class

OembedUpdateTest
Tests eager-load upgrade path.

Namespace

Drupal\Tests\media\Functional\FieldFormatter

Code

protected function setUp() : void {
    parent::setUp();
    // Because the test manually installs media module, the entity type config
    // must be manually installed similar to kernel tests.
    $entity_type_manager = \Drupal::entityTypeManager();
    $media = $entity_type_manager->getDefinition('media');
    \Drupal::service('entity_type.listener')->onEntityTypeCreate($media);
    $media_type = $entity_type_manager->getDefinition('media_type');
    \Drupal::service('entity_type.listener')->onEntityTypeCreate($media_type);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.