You are here

public function BlockContentEntityReferenceSelectionTest::testNoConditions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php \Drupal\Tests\block_content\Kernel\BlockContentEntityReferenceSelectionTest::testNoConditions()

Tests with no conditions set.

Throws

\Drupal\Core\Entity\EntityStorageException

File

core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php, line 147

Class

BlockContentEntityReferenceSelectionTest
Tests EntityReference selection handlers don't return non-reusable blocks.

Namespace

Drupal\Tests\block_content\Kernel

Code

public function testNoConditions() {
  $this
    ->assertEquals($this->expectations['block_reusable'], $this->selectionHandler
    ->getReferenceableEntities());
  $this->blockNonReusable
    ->setReusable();
  $this->blockNonReusable
    ->save();

  // Ensure that the block is now returned as a referenceable entity.
  $this
    ->assertEquals($this->expectations['both_blocks'], $this->selectionHandler
    ->getReferenceableEntities());
}