function BlockContentEntityReferenceSelectionTest::testFieldConditions

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

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