You are here

protected function BlockTestTrait::createBlock in Facets 8

Creates a facet block by id.

Parameters

string $id: The id of the block.

Return value

\Drupal\block\Entity\Block The block entity.

5 calls to BlockTestTrait::createBlock()
BlockTestTrait::createFacet in tests/src/Functional/BlockTestTrait.php
Add a facet trough the UI.
IntegrationTest::testBlockView in tests/src/Functional/IntegrationTest.php
Tests that a block view also works.
IntegrationTest::testFacetCountCalculations in tests/src/Functional/IntegrationTest.php
Tests calculations of facet count.
IntegrationTest::testFacetDependencies in tests/src/Functional/IntegrationTest.php
Tests facet dependencies.
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Facets' admin UI.

File

tests/src/Functional/BlockTestTrait.php, line 71

Class

BlockTestTrait
Shared test methods for facet blocks.

Namespace

Drupal\Tests\facets\Functional

Code

protected function createBlock($id) {
  $block = [
    'region' => 'footer',
    'id' => str_replace('_', '-', $id),
  ];
  return $this
    ->drupalPlaceBlock('facet_block:' . $id, $block);
}