function BlockContentEntityReferenceSelectionTest::testNoConditions

Same name in other branches
  1. 9 core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php \Drupal\Tests\block_content\Kernel\BlockContentEntityReferenceSelectionTest::testNoConditions()
  2. 8.9.x core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php \Drupal\Tests\block_content\Kernel\BlockContentEntityReferenceSelectionTest::testNoConditions()
  3. 10 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 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.