You are here

public function FixedToContentMappingTest::testSetBlockContent in Fixed Block Content 8

Tests the set block content method.

File

tests/src/Kernel/FixedToContentMappingTest.php, line 42

Class

FixedToContentMappingTest
Tests the fixed block content mapping handler.

Namespace

Drupal\Tests\fixed_block_content\Kernel

Code

public function testSetBlockContent() {

  // Get the block content, it will be created.
  $this->mappingHandler
    ->setBlockContent($this->fixedBlock, $this->blockContent);

  // Check that the fixed block has now the linked block content.
  $this
    ->assertEquals($this->blockContent
    ->id(), $this->fixedBlock
    ->getBlockContent(FALSE)
    ->id());

  // Setting the same block again should silently exit.
  $this->mappingHandler
    ->setBlockContent($this->fixedBlock, $this->blockContent);
}