class BlockContentRemoveListingEmptyUpdateTest
Tests the removal of the empty listing plugin.
Attributes
#[Group('Update')]
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\block_content\Functional\Update\BlockContentRemoveListingEmptyUpdateTest extends \Drupal\FunctionalTests\Update\UpdatePathTestBase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of BlockContentRemoveListingEmptyUpdateTest
See also
block_content_post_update_remove_block_content_listing_empty()
File
-
core/
modules/ block_content/ tests/ src/ Functional/ Update/ BlockContentRemoveListingEmptyUpdateTest.php, line 16
Namespace
Drupal\Tests\block_content\Functional\UpdateView source
class BlockContentRemoveListingEmptyUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() : void {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-10.3.0.filled.standard.php.gz',
];
}
/**
* Tests the upgrade path to remove the empty listing plugin.
*/
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.