You are here

protected function TestImporter::setUp in Feeds Paragraphs 8

@inheritdoc

Overrides FpmTestBase::setUp

File

tests/src/Unit/TestImporter.php, line 43

Class

TestImporter
@group Feeds Paragraphs @coversDefaultClass \Drupal\feeds_para_mapper\Importer

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

protected function setUp() {
  $this->class = Text::class;
  $this->type = "text";
  parent::setUp();
  $this
    ->addServices($this->services);
  $entity_manager = $this->entityHelper
    ->getEntityTypeManagerMock()
    ->reveal();
  $field_manager = $this->fieldHelper
    ->getEntityFieldManagerMock();
  $mapper = $this
    ->getMapperObject();
  try {
    $this->importer = new Importer($entity_manager, $field_manager, $mapper);
  } catch (\Exception $e) {
  }
  $targets = $mapper
    ->getTargets('node', 'products');
  $this->field = $targets[0];
  $this
    ->initImporter();
}