You are here

public function MediaTest::testNameBaseField in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testNameBaseField()
  2. 9 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testNameBaseField()

Tests the Media "name" base field behavior.

File

core/modules/media/tests/src/Kernel/MediaTest.php, line 26

Class

MediaTest
Tests Media.

Namespace

Drupal\Tests\media\Kernel

Code

public function testNameBaseField() {

  /** @var \Drupal\Core\Field\BaseFieldDefinition[] $field_definitions */
  $field_definitions = $this->container
    ->get('entity_field.manager')
    ->getBaseFieldDefinitions('media');

  // Ensure media name is configurable on manage display.
  $this
    ->assertTrue($field_definitions['name']
    ->isDisplayConfigurable('view'));

  // Ensure it is not visible by default.
  $this
    ->assertSame($field_definitions['name']
    ->getDisplayOptions('view'), [
    'region' => 'hidden',
  ]);
}