You are here

public function TestMapper::testFindParagraphsFields in Feeds Paragraphs 8

@covers ::findParagraphsFields

File

tests/src/Unit/TestMapper.php, line 60

Class

TestMapper
@group Feeds Paragraphs @coversDefaultClass \Drupal\feeds_para_mapper\Mapper

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

public function testFindParagraphsFields() {
  $fields = $this->mapper
    ->findParagraphsFields('node', 'product');
  $message = "Paragraphs fields found";
  $isFound = count($fields) && $fields[0]
    ->getType() === "entity_reference_revisions";
  self::assertTrue($isFound, $message);
  $fields = $this->mapper
    ->findParagraphsFields('test', 'test');
  $message = "Returns empty array if no paragraphs fields found";
  self::assertTrue(is_array($fields) && count($fields) === 0, $message);
}