You are here

public function TestImporter::testInitHostParagraphs in Feeds Paragraphs 8

@covers ::initHostParagraphs

File

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

Class

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

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

public function testInitHostParagraphs() {
  $this->entityHelper->values = array();
  $method = $this
    ->getMethod(Importer::class, 'initHostParagraphs');
  $result = $method
    ->invoke($this->importer);
  foreach ($result as $item) {
    $paragraph = $item['paragraph'];
    $host_info = $paragraph->host_info;
    self::assertNotNull($host_info);
    self::assertTrue(count($host_info) === 4, "The info array should contain 4 items");
    $value = $item['value'];
    self::assertTrue(count($value) > 0, "The value key contains values");
  }
}