You are here

public function EntityFieldExportTest::providerItems in REST Views 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/EntityFieldExportTest.php \Drupal\Tests\rest_views\Unit\EntityFieldExportTest::providerItems()

Data provider for ::testRenderItems().

Return value

array Test case data.

File

tests/src/Unit/EntityFieldExportTest.php, line 173

Class

EntityFieldExportTest
Test the EntityFieldExport views field plugin.

Namespace

Drupal\Tests\rest_views\Unit

Code

public function providerItems() {
  $data[] = [
    'items' => [
      'Lorem',
      'ipsum',
      'dolor',
      'sit',
      'amet',
    ],
    'expected' => [
      'Lorem',
      'ipsum',
      'dolor',
      'sit',
      'amet',
    ],
  ];
  $data[] = [
    'items' => [
      new SerializedData([
        'lorem' => 'ipsum',
      ]),
      new SerializedData([
        'dolor' => TRUE,
      ]),
      new SerializedData([
        'amet' => 42,
      ]),
    ],
    'expected' => [
      [
        'lorem' => 'ipsum',
      ],
      [
        'dolor' => TRUE,
      ],
      [
        'amet' => 42,
      ],
    ],
  ];
  return $data;
}