You are here

public function BlockStyleBaseTest::testSetBlockContentBundle in Block Style Plugins 8

Tests the setBlockContentBundle method.

See also

::setBlockContentBundle()

File

tests/src/Unit/Plugin/BlockStyleBaseTest.php, line 443

Class

BlockStyleBaseTest
@coversDefaultClass \Drupal\block_style_plugins\Plugin\BlockStyleBase @group block_style_plugins

Namespace

Drupal\Tests\block_style_plugins\Unit\Plugin

Code

public function testSetBlockContentBundle() {

  // Stub the blockPlugin.
  $this
    ->setProtectedProperty('blockPlugin', $this->blockPlugin
    ->reveal());
  $entity = $this
    ->prophesize(EntityInterface::CLASS);
  $entity
    ->bundle()
    ->willReturn('basic_custom_block');
  $this->entityRepository
    ->loadEntityByUuid('block_content', 'uuid-1234')
    ->willReturn($entity
    ->reveal());
  $this->plugin
    ->setBlockContentBundle();
  $bundle = $this
    ->getProtectedProperty('blockContentBundle');
  $this
    ->assertEquals('basic_custom_block', $bundle);
}