You are here

public function BlockContentEntityReferenceSelectionTest::testFieldConditions 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::testFieldConditions()

Tests setting 'reusable' condition on different levels.

@dataProvider fieldConditionProvider

Throws

\Exception

File

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

Class

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

Namespace

Drupal\Tests\block_content\Kernel

Code

public function testFieldConditions($condition_type, $is_reusable) {
  $this->selectionHandler
    ->setTestMode($condition_type, $is_reusable);
  $this
    ->assertEquals($is_reusable ? $this->expectations['block_reusable'] : $this->expectations['block_non_reusable'], $this->selectionHandler
    ->getReferenceableEntities());
}