You are here

protected function EntityRenderHandlerTest::setUp in Acquia Lift Connector 8.4

Throws

\ReflectionException

\Drupal\Core\Entity\EntityStorageException

Overrides KernelTestBase::setUp

File

modules/acquia_lift_publisher/tests/src/Kernel/EventSubscriber/Cdf/EntityRenderHandlerTest.php, line 90

Class

EntityRenderHandlerTest
Class EntityRenderHandlerTest.

Namespace

Drupal\Tests\acquia_lift_publisher\Kernel\EventSubscriber\Cdf

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('acquia_contenthub_publisher', [
    'acquia_contenthub_publisher_export_tracking',
  ]);
  $this
    ->installEntitySchema('block_content');
  $this
    ->installEntitySchema('block');
  $this
    ->installEntitySchema('filter_format');
  $this
    ->installEntitySchema('file');
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('path_alias');
  $this
    ->installEntitySchema('user');
  $this
    ->installSchema('system', 'sequences');
  $this
    ->installSchema('file', 'file_usage');
  $this
    ->installConfig([
    'node',
    'block_content',
    'user',
    'file',
    'image',
    'filter',
    'acquia_lift_publisher',
  ]);
  $this->blockType = BlockContentType::create([
    'id' => $this
      ->randomMachineName(),
    'label' => $this
      ->randomString(),
  ]);
  $this->blockType
    ->save();
  $document = $this
    ->prophesize(CDFDocument::class);
  $client = $this
    ->prophesize(ContentHubClient::class);
  $client
    ->getEntities(Argument::type('array'))
    ->willReturn($document
    ->reveal());
  $settings = new Settings(NULL, NULL, NULL, NULL, NULL);
  $client_factory = $this
    ->prophesize(ClientFactory::class);
  $client_factory
    ->getClient()
    ->willReturn($client
    ->reveal());
  $client_factory
    ->getSettings()
    ->willReturn($settings);
  $this->container
    ->set('acquia_contenthub.client.factory', $client_factory
    ->reveal());
}