You are here

public function EntityRenderHandlerTest::testOnCreateCdfBlockContent in Acquia Lift Connector 8.4

@covers ::onCreateCdf

Throws

\Drupal\Core\Entity\EntityStorageException

\Exception

File

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

Class

EntityRenderHandlerTest
Class EntityRenderHandlerTest.

Namespace

Drupal\Tests\acquia_lift_publisher\Kernel\EventSubscriber\Cdf

Code

public function testOnCreateCdfBlockContent() {
  ConfigurableLanguage::create([
    'id' => 'hu',
    'label' => 'Hungarian',
  ])
    ->save();
  $block = $this
    ->createBlockContent();
  $block
    ->addTranslation('hu', [
    'info' => $this
      ->randomString(),
  ]);
  $this
    ->enableViewModeExportFor($block);
  $event = $this
    ->dispatchWith($block, []);
  $cdfs = $this
    ->getRenderedEntities($event
    ->getCdfList());
  $this
    ->assertCount(2, $cdfs, 'All entities were rendered.');
  $this
    ->assertCdfAttributes($block, $cdfs);
}