You are here

public function FieldBlockTest::providerTestBuild in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::providerTestBuild()
  2. 10 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::providerTestBuild()

Provides test data for ::testBuild().

File

core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php, line 274

Class

FieldBlockTest
@coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock @group Field

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function providerTestBuild() {
  $data = [];
  $data['array'] = [
    new ReturnPromise([
      [
        'content' => [
          '#markup' => 'The field value',
        ],
      ],
    ]),
    'The field value',
  ];
  $data['empty array'] = [
    new ReturnPromise([
      [],
    ]),
    '',
  ];
  return $data;
}