public function MediaTest::testNameBaseField in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testNameBaseField()
- 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\KernelCode
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',
]);
}