You are here

public function LanguageContentSettingsTest::providerSource in Drupal 10

Same name in this branch
  1. 10 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentSettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d6\LanguageContentSettingsTest::providerSource()
  2. 10 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d7/LanguageContentSettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d7\LanguageContentSettingsTest::providerSource()
Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentSettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d6\LanguageContentSettingsTest::providerSource()
  2. 9 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentSettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d6\LanguageContentSettingsTest::providerSource()

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

core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentSettingsTest.php, line 24

Class

LanguageContentSettingsTest
Tests menu source plugin.

Namespace

Drupal\Tests\language\Kernel\Plugin\migrate\source\d6

Code

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

  // The source data.
  $tests[0]['source_data']['node_type'] = [
    [
      'type' => 'article',
      'name' => 'Article',
      'module' => 'node',
      'description' => 'An <em>article</em>, content type.',
      'help' => '',
      'has_title' => 1,
      'title_label' => 'Title',
      'has_body' => 1,
      'body_label' => 'Body',
      'min_word_count' => 0,
      'custom' => 1,
      'modified' => 1,
      'locked' => 0,
      'orig_type' => 'story',
    ],
    [
      'type' => 'company',
      'name' => 'Company',
      'module' => 'node',
      'description' => 'Company node type',
      'help' => '',
      'has_title' => 1,
      'title_label' => 'Name',
      'has_body' => 1,
      'body_label' => 'Description',
      'min_word_count' => 0,
      'custom' => 0,
      'modified' => 1,
      'locked' => 0,
      'orig_type' => 'company',
    ],
  ];
  foreach ($tests[0]['source_data']['node_type'] as $node_type) {
    $tests[0]['expected_data'][] = [
      'type' => $node_type['type'],
      'language_content_type' => NULL,
      'i18n_lock_node' => 0,
    ];
  }
  return $tests;
}