BlockNodeTypeVisibilityUpdateTest.php in Drupal 9
File
core/modules/block/tests/src/Functional/Update/BlockNodeTypeVisibilityUpdateTest.php
View source
<?php
namespace Drupal\Tests\block\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class BlockNodeTypeVisibilityUpdateTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.0.0.filled.standard.php.gz',
];
}
public function testBlock() {
$bundles = [
'article' => 'article',
'test_content_type' => 'test_content_type',
];
$block = \Drupal::config('block.block.stark_testblock');
$this
->assertEquals($bundles, $block
->get('visibility.node_type.bundles'));
$this
->assertNull($block
->get('visibility.entity_bundle:node'));
$this
->runUpdates();
$block = \Drupal::config('block.block.stark_testblock');
$this
->assertEquals($bundles, $block
->get('visibility.entity_bundle:node.bundles'));
$this
->assertEquals('entity_bundle:node', $block
->get('visibility.entity_bundle:node.id'));
$this
->assertNull($block
->get('visibility.node_type'));
}
}