function BlockContentEntityReferenceSelectionTest::testNoConditions

Tests with no conditions set.

Throws

\Drupal\Core\Entity\EntityStorageException

File

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

Class

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

Namespace

Drupal\Tests\block_content\Kernel

Code

public function testNoConditions() : void {
  $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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.