function MigrateBlockTest::assertEntity
Same name in this branch
- 8.9.x core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::assertEntity()
Same name in other branches
- 9 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\aggregator\Kernel\Migrate\d6\MigrateBlockTest::assertEntity()
- 9 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::assertEntity()
- 9 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::assertEntity()
- 10 core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateBlockTest::assertEntity()
- 10 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::assertEntity()
- 10 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::assertEntity()
- 11.x core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateBlockTest::assertEntity()
- 11.x core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::assertEntity()
- 11.x core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::assertEntity()
Asserts various aspects of a block.
Parameters
string $id: The block ID.
array $visibility: The block visibility settings.
string $region: The display region.
string $theme: The theme.
string $weight: The block weight.
array $settings: (optional) The block settings.
bool $status: Whether the block is expected to be enabled or disabled.
1 call to MigrateBlockTest::assertEntity()
- MigrateBlockTest::testBlockMigration in core/
modules/ block/ tests/ src/ Kernel/ Migrate/ d6/ MigrateBlockTest.php - Tests the block migration.
File
-
core/
modules/ block/ tests/ src/ Kernel/ Migrate/ d6/ MigrateBlockTest.php, line 79
Class
- MigrateBlockTest
- Tests migration of blocks to configuration entities.
Namespace
Drupal\Tests\block\Kernel\Migrate\d6Code
public function assertEntity($id, $visibility, $region, $theme, $weight, array $settings = NULL, $status = TRUE) {
$block = Block::load($id);
$this->assertInstanceOf(Block::class, $block);
$this->assertSame($visibility, $block->getVisibility());
$this->assertSame($region, $block->getRegion());
$this->assertSame($theme, $block->getTheme());
$this->assertSame($weight, $block->getWeight());
$this->assertSame($status, $block->status());
if ($settings) {
$block_settings = $block->get('settings');
$block_settings['id'] = current(explode(':', $block_settings['id']));
$this->assertEquals($settings, $block_settings);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.