public function MediaLibrarySetAdministrativePageToTableDisplayTest::testUpdateWithoutCustomizations in Drupal 8
Tests that the update alters uncustomized path and menu settings.
File
- core/
modules/ media_library/ tests/ src/ Functional/ Update/ MediaLibrarySetAdministrativePageToTableDisplayTest.php, line 30
Class
- MediaLibrarySetAdministrativePageToTableDisplayTest
- Tests update to set 'media' view's table display as the administrative page.
Namespace
Drupal\Tests\media_library\Functional\UpdateCode
public function testUpdateWithoutCustomizations() {
/** @var \Drupal\views\ViewEntityInterface $view */
$view = View::load('media');
$display = $view
->getDisplay('media_page_list');
$this
->assertSame('admin/content/media-table', $display['display_options']['path']);
$this
->assertArrayNotHasKey('menu', $display['display_options']);
$view = View::load('media_library');
$display = $view
->getDisplay('page');
$this
->assertSame('admin/content/media', $display['display_options']['path']);
$this
->assertSame('tab', $display['display_options']['menu']['type']);
$this
->assertSame('Media', $display['display_options']['menu']['title']);
$this
->runUpdates();
$view = View::load('media');
$display = $view
->getDisplay('media_page_list');
$this
->assertSame('admin/content/media', $display['display_options']['path']);
$this
->assertArrayNotHasKey('menu', $display['display_options']);
$view = View::load('media_library');
$display = $view
->getDisplay('page');
$this
->assertSame('admin/content/media-grid', $display['display_options']['path']);
$this
->assertArrayNotHasKey('menu', $display['display_options']);
}