You are here

private function FpmTestBase::initWrapper in Feeds Paragraphs 8

Instantiates and returns a WrapperTarget object.

1 call to FpmTestBase::initWrapper()
FpmTestBase::setUp in tests/src/Unit/FpmTestBase.php
@inheritdoc

File

tests/src/Unit/FpmTestBase.php, line 152

Class

FpmTestBase

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

private function initWrapper() {
  $method = $this
    ->getMethod('Drupal\\feeds_para_mapper\\Feeds\\Target\\WrapperTarget', 'prepareTarget')
    ->getClosure();
  $this->feedType = $this
    ->getFeedTypeMock();
  $field = $this->fields[1]
    ->reveal();
  $field
    ->set('target_info', $this
    ->getTargetInfo());
  $configuration = [
    'feed_type' => $this->feedType,
    'target_definition' => $method($field),
  ];
  $id = "wrapper_target";
  $plugin_definition = array();

  // Sets instanceMock and target variables:
  $target = $this
    ->getInstanceMock();
  $this->instanceMock = $target;
  $this->target = $target
    ->reveal();
  $plugin_manager = $this
    ->getPluginManagerMock();
  $mapper = $this
    ->getMapperObject();
  $wrapperTarget = new WrapperTarget($configuration, $id, $plugin_definition, $this->messenger
    ->reveal(), $plugin_manager, $mapper);
  $this->wrapperTarget = $wrapperTarget;
}