function BlockContentRemoveListingEmptyUpdateTest::testBlockContentPostUpdateRemoveBlockContentListingEmpty
Tests the upgrade path to remove the empty listing plugin.
File
-
core/
modules/ block_content/ tests/ src/ Functional/ Update/ BlockContentRemoveListingEmptyUpdateTest.php, line 31
Class
- BlockContentRemoveListingEmptyUpdateTest
- Tests the removal of the empty listing plugin.
Namespace
Drupal\Tests\block_content\Functional\UpdateCode
public function testBlockContentPostUpdateRemoveBlockContentListingEmpty() : void {
$view = View::load('block_content');
$data = $view->toArray();
// Plugin exists in the view before updates.
$this->assertNotEmpty($data['display']['default']['display_options']['empty']['block_content_listing_empty']);
$this->runUpdates();
$view = View::load('block_content');
$data = $view->toArray();
// Plugin is removed from the view after updates.
$this->assertArrayNotHasKey('block_content_listing_empty', $data['display']['default']['display_options']['empty']);
// Other empty plugins still remain.
$this->assertNotEmpty($data['display']['default']['display_options']['empty']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.