You are here

public function EckEntityBundleTest::providerSource in Entity Construction Kit (ECK) 8

The data provider.

Return value

array Array of data sets to test, each of which is a numerically indexed array with the following elements:

  • An array of source data, which can be optionally processed and set up by subclasses.
  • An array of expected result rows.
  • (optional) The number of result rows the plugin under test is expected to return. If this is not a numeric value, the plugin will not be counted.
  • (optional) Array of configuration options for the plugin under test.

Overrides MigrateSourceTestBase::providerSource

See also

\Drupal\Tests\migrate\Kernel\MigrateSourceTestBase::testSource

File

tests/src/Kernel/Plugin/migrate/source/d7/EckEntityBundleTest.php, line 24

Class

EckEntityBundleTest
Tests D7 ECK entity bundle source plugin.

Namespace

Drupal\Tests\eck\Kernel\Plugin\migrate\source\d7

Code

public function providerSource() {
  $tests = [];

  // The source data.
  $tests[0]['database']['eck_bundle'] = [
    [
      'id' => '1',
      'machine_name' => 'simple_entity_simple_entity',
      'entity_type' => 'simple_entity',
      'name' => 'simple_entity',
      'label' => 'Simple entity',
      'config' => '[]',
    ],
    [
      'id' => '2',
      'machine_name' => 'complex_entity_complex_entity',
      'entity_type' => 'complex_entity',
      'name' => 'complex_entity',
      'label' => 'Complex entity',
      'config' => '{"managed_properties":{"title":0,"uid":0,"created":0,"changed":0,"language":0,"description":0},"multilingual":"1"}',
    ],
    [
      'id' => '3',
      'machine_name' => 'complex_entity_another_bundle',
      'entity_type' => 'complex_entity',
      'name' => 'another_bundle',
      'label' => 'Another bundle',
      'config' => '[]',
    ],
  ];
  $tests[0]['expected_results'] = $tests[0]['database']['eck_bundle'];
  return $tests;
}