function BlockRegionTest::transform
Same name in other branches
- 9 core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php \Drupal\Tests\block\Unit\Plugin\migrate\process\BlockRegionTest::transform()
- 8.9.x core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php \Drupal\Tests\block\Unit\Plugin\migrate\process\BlockRegionTest::transform()
- 11.x core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php \Drupal\Tests\block\Unit\Plugin\migrate\process\BlockRegionTest::transform()
Transforms a value through the block_region plugin.
Parameters
array $value: The value to transform.
\Drupal\migrate\Row|null $row: (optional) The mocked row.
Return value
array|string The transformed value.
2 calls to BlockRegionTest::transform()
- BlockRegionTest::testTransformSameThemeRegionExists in core/
modules/ block/ tests/ src/ Unit/ Plugin/ migrate/ process/ BlockRegionTest.php - Tests transforming a block with the same theme and an existing region.
- BlockRegionTest::testTransformSameThemeRegionNotExists in core/
modules/ block/ tests/ src/ Unit/ Plugin/ migrate/ process/ BlockRegionTest.php - Tests transforming a block with the same theme and a non-existent region.
File
-
core/
modules/ block/ tests/ src/ Unit/ Plugin/ migrate/ process/ BlockRegionTest.php, line 29
Class
- BlockRegionTest
- @coversDefaultClass \Drupal\block\Plugin\migrate\process\BlockRegion @group block
Namespace
Drupal\Tests\block\Unit\Plugin\migrate\processCode
protected function transform(array $value, ?Row $row = NULL) {
$executable = $this->prophesize(MigrateExecutableInterface::class)
->reveal();
if (empty($row)) {
$row = $this->prophesize(Row::class)
->reveal();
}
$configuration = [
'map' => [
'bartik' => [
'bartik' => [
'triptych_first' => 'triptych_first',
'triptych_middle' => 'triptych_second',
'triptych_last' => 'triptych_third',
],
],
],
'default_value' => 'content',
];
$plugin = new BlockRegion($configuration, 'block_region', [], $configuration['map']['bartik']['bartik']);
return $plugin->transform($value, $executable, $row, 'foo');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.