Commit da40533f authored by catch's avatar catch

Issue #2940169 by Nitebreed, jefuri, seanB: Remove all occurences of 'media entity' in core

parent 0873fe9b
......@@ -91,7 +91,7 @@ class MediaSource extends Plugin {
/**
* (optional) The metadata attribute name to provide the thumbnail title.
*
* The name of the media entity will be used if the attribute name is not
* The name of the media item will be used if the attribute name is not
* provided.
*
* @var string|null
......
......@@ -8,7 +8,7 @@
use Drupal\Core\Session\AccountInterface;
/**
* Defines an access control handler for the media entity.
* Defines an access control handler for media items.
*/
class MediaAccessControlHandler extends EntityAccessControlHandler {
......
......@@ -100,7 +100,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
$link_types = [
'content' => $this->t('Content'),
'media' => $this->t('Media entity'),
'media' => $this->t('Media item'),
];
$element['image_link']['#options'] = $link_types;
......
......@@ -7,7 +7,7 @@
use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase;
/**
* Tests the media entity's cache tags.
* Tests the media items cache tags.
*
* @group media
*/
......
......@@ -13,7 +13,7 @@ trait MediaFunctionalTestTrait {
* @var array
*/
protected static $adminUserPermissions = [
// Media entity permissions.
// Media module permissions.
'administer media',
'administer media fields',
'administer media form display',
......
......@@ -109,7 +109,7 @@ protected function createMediaType($media_source_name) {
}
/**
* Helper to generate media entity.
* Helper to generate a media item.
*
* @param string $filename
* String filename with extension.
......@@ -117,7 +117,7 @@ protected function createMediaType($media_source_name) {
* The the media type.
*
* @return \Drupal\media\Entity\Media
* A media entity.
* A media item.
*/
protected function generateMedia($filename, MediaTypeInterface $media_type) {
vfsStream::setup('drupal_root');
......
......@@ -5,7 +5,7 @@
use Drupal\media\Entity\Media;
/**
* Tests link relationships for Media entity.
* Tests link relationships for media items.
*
* @group media
*/
......@@ -20,7 +20,7 @@ public function testExistLinkRelationships() {
$media = Media::create(['bundle' => $this->testMediaType->id()]);
$media->save();
foreach ($media->uriRelationships() as $relation_name) {
$this->assertTrue($link_relation_type_manager->hasDefinition($relation_name), "Link relationship '{$relation_name}' for Media entity");
$this->assertTrue($link_relation_type_manager->hasDefinition($relation_name), "Link relationship '{$relation_name}' for a media item");
}
}
......
......@@ -161,7 +161,7 @@ public function testThumbnail() {
file_put_contents('public://thumbnail1.jpg', '');
file_put_contents('public://thumbnail2.jpg', '');
// Save a media entity and make sure thumbnail was added.
// Save a media item and make sure thumbnail was added.
\Drupal::state()->set('media_source_test_attributes', [
'thumbnail_uri' => ['title' => 'Thumbnail', 'value' => 'public://thumbnail1.jpg'],
]);
......@@ -174,7 +174,7 @@ public function testThumbnail() {
$media_source = $media->getSource();
$this->assertEquals('public://thumbnail1.jpg', $media_source->getMetadata($media, 'thumbnail_uri'), 'Value of the thumbnail metadata attribute is not correct.');
$media->save();
$this->assertEquals('public://thumbnail1.jpg', $media->thumbnail->entity->getFileUri(), 'Thumbnail was not added to the media entity.');
$this->assertEquals('public://thumbnail1.jpg', $media->thumbnail->entity->getFileUri(), 'Thumbnail was not added to the media item.');
$this->assertEquals('Mr. Jones', $media->thumbnail->title, 'Title text was not set on the thumbnail.');
$this->assertEquals('Thumbnail', $media->thumbnail->alt, 'Alt text was not set on the thumbnail.');
......@@ -193,7 +193,7 @@ public function testThumbnail() {
$media->thumbnail->target_id = NULL;
$this->assertEquals('public://thumbnail2.jpg', $media_source->getMetadata($media, 'thumbnail_uri'), 'Value of the thumbnail metadata attribute is not correct.');
$media->save();
$this->assertEquals('public://thumbnail2.jpg', $media->thumbnail->entity->getFileUri(), 'New thumbnail was not added to the media entity.');
$this->assertEquals('public://thumbnail2.jpg', $media->thumbnail->entity->getFileUri(), 'New thumbnail was not added to the media item.');
$this->assertEquals('Mr. Jones', $media->thumbnail->title, 'Title text was not set on the thumbnail.');
$this->assertEquals('Thumbnail', $media->thumbnail->alt, 'Alt text was not set on the thumbnail.');
......@@ -205,7 +205,7 @@ public function testThumbnail() {
$media->field_media_test->value = 'some_new_value';
$this->assertEquals('public://thumbnail1.jpg', $media_source->getMetadata($media, 'thumbnail_uri'), 'Value of the thumbnail metadata attribute is not correct.');
$media->save();
$this->assertEquals('public://thumbnail1.jpg', $media->thumbnail->entity->getFileUri(), 'New thumbnail was not added to the media entity.');
$this->assertEquals('public://thumbnail1.jpg', $media->thumbnail->entity->getFileUri(), 'New thumbnail was not added to the media item.');
$this->assertEquals('Mr. Jones', $media->thumbnail->title, 'Title text was not set on the thumbnail.');
$this->assertEquals('Thumbnail', $media->thumbnail->alt, 'Alt text was not set on the thumbnail.');
......@@ -282,13 +282,13 @@ public function testThumbnail() {
'field_media_test' => 'some_value',
]);
$media->save();
$this->assertEquals('Boxer', $media->getName(), 'Correct name was not set on the media entity.');
$this->assertEquals('Boxer', $media->getName(), 'Correct name was not set on the media item.');
$this->assertEquals('This will be title.', $media->thumbnail->title, 'Title text was not set on the thumbnail.');
$this->assertEquals('This will be alt.', $media->thumbnail->alt, 'Alt text was not set on the thumbnail.');
}
/**
* Tests the media entity constraints functionality.
* Tests the media item constraints functionality.
*/
public function testConstraints() {
// Test entity constraints.
......
......@@ -12,7 +12,7 @@
class MediaTest extends MediaKernelTestBase {
/**
* Tests various aspects of a Media entity.
* Tests various aspects of a media item.
*/
public function testEntity() {
$media = Media::create(['bundle' => $this->testMediaType->id()]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment