You are here

public function ReferenceTest::setUp in YAML Content 8

Setup mocks and a reference plugin for all tests.

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/yaml_content/process/ReferenceTest.php, line 48

Class

ReferenceTest
Test entity reference processing.

Namespace

Drupal\Tests\yaml_content\Unit\Plugin\yaml_content\process

Code

public function setUp() {
  parent::setUp();
  $this->entityTypeManager = $this
    ->prophesize(EntityTypeManagerInterface::class);
  $this->entityStorageHandler = $this
    ->prophesize(EntityStorageInterface::class);
  $this->entityTypeManager
    ->getStorage(Argument::type('string'))
    ->willReturn($this->entityStorageHandler
    ->reveal());
  $this->reference = new Reference([
    'my_entity',
    [
      'title' => 'My First Blog Post',
    ],
  ], 'reference', [], $this->entityTypeManager
    ->reveal());
}