MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest.php in Drupal 8
File
core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest.php
View source
<?php
namespace Drupal\Tests\media_library\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
__DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php',
__DIR__ . '/../../../fixtures/update/drupal-8.7.2-media_library_installed.php',
];
}
public function testMediaLibraryViewsConfig() {
$config = $this
->config('views.view.media_library');
$this
->assertNull($config
->get('display.page.display_options.defaults.fields'));
$this
->assertNull($config
->get('display.page.display_options.fields.name'));
$this
->assertNull($config
->get('display.page.display_options.fields.edit_media'));
$this
->assertNull($config
->get('display.page.display_options.fields.delete_media'));
$this
->runUpdates();
$config = $this
->config('views.view.media_library');
$this
->assertFalse($config
->get('display.page.display_options.defaults.fields'));
$this
->assertSame('field', $config
->get('display.page.display_options.fields.name.plugin_id'));
$this
->assertSame('name', $config
->get('display.page.display_options.fields.name.entity_field'));
$this
->assertSame('entity_link_edit', $config
->get('display.page.display_options.fields.edit_media.plugin_id'));
$this
->assertSame('entity_link_delete', $config
->get('display.page.display_options.fields.delete_media.plugin_id'));
$fields = $config
->get('display.page.display_options.fields');
end($fields);
$this
->assertSame('rendered_entity', key($fields));
}
}