Exemplo n.º 1
0
 /**
  * Transforms a value through the block_region plugin.
  *
  * @param array $value
  *   The value to transform.
  * @param \Drupal\migrate\Row|NULL $row
  *   (optional) The mocked row.
  *
  * @return array|string
  *   The transformed value.
  */
 protected function transform(array $value, Row $row = NULL)
 {
     $executable = $this->prophesize(MigrateExecutableInterface::class)->reveal();
     if (empty($row)) {
         $row = $this->prophesize(Row::class)->reveal();
     }
     $regions = array('bartik' => array('triptych_first' => 'Triptych first', 'triptych_second' => 'Triptych second', 'triptych_third' => 'Triptych third'));
     $plugin = new BlockRegion(['region_map' => []], 'block_region', [], $regions);
     return $plugin->transform($value, $executable, $row, 'foo');
 }
Exemplo n.º 2
0
 /**
  * Transforms a value through the block_region plugin.
  *
  * @param array $value
  *   The value to transform.
  * @param \Drupal\migrate\Row|null $row
  *   (optional) The mocked row.
  *
  * @return array|string
  *   The transformed value.
  */
 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');
 }