You are here

public function OEmbedFormatterTest::testDisplayConfiguration in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php \Drupal\Tests\media\Functional\FieldFormatter\OEmbedFormatterTest::testDisplayConfiguration()
  2. 9 core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php \Drupal\Tests\media\Functional\FieldFormatter\OEmbedFormatterTest::testDisplayConfiguration()

Tests that oEmbed media types' display can be configured correctly.

File

core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php, line 142

Class

OEmbedFormatterTest
@covers \Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter

Namespace

Drupal\Tests\media\Functional\FieldFormatter

Code

public function testDisplayConfiguration() {
  $account = $this
    ->drupalCreateUser([
    'administer media display',
  ]);
  $this
    ->drupalLogin($account);
  $media_type = $this
    ->createMediaType('oembed:video');
  $this
    ->drupalGet('/admin/structure/media/manage/' . $media_type
    ->id() . '/display');
  $assert = $this
    ->assertSession();
  $assert
    ->statusCodeEquals(200);

  // Test that the formatter doesn't try to check applicability for fields
  // which do not have a specific target bundle.
  // @see https://www.drupal.org/project/drupal/issues/2976795.
  $assert
    ->pageTextNotContains('Can only flip STRING and INTEGER values!');
}