function BlockContentEntityReferenceSelectionTest::testFieldConditions

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

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) : void {
    $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.