You are here

public function FieldHelper::getEntityFieldManagerMock in Feeds Paragraphs 8

Creates entity field manager instance.

Return value

EntityFieldManagerInterface A mocked entity field manager instance.

File

tests/src/Unit/Helpers/FieldHelper.php, line 153

Class

FieldHelper

Namespace

Drupal\Tests\feeds_para_mapper\Unit\Helpers

Code

public function getEntityFieldManagerMock() {
  $manager = $this->prophet
    ->prophesize(EntityFieldManagerInterface::class);
  $that = $this;
  $manager
    ->getFieldDefinitions(Argument::type('string'), Argument::type('string'))
    ->will(function ($args) use ($that) {
    return $that
      ->getFieldDefinitions($args[0], $args[1]);
  });
  return $manager
    ->reveal();
}