You are here

public function LanguageContentTaxonomyVocabularySettingsTest::providerSource in Drupal 10

Same name in this branch
  1. 10 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d6\LanguageContentTaxonomyVocabularySettingsTest::providerSource()
  2. 10 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d7/LanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d7\LanguageContentTaxonomyVocabularySettingsTest::providerSource()
Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d7/LanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d7\LanguageContentTaxonomyVocabularySettingsTest::providerSource()
  2. 9 core/modules/language/tests/src/Kernel/Plugin/migrate/source/d7/LanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Plugin\migrate\source\d7\LanguageContentTaxonomyVocabularySettingsTest::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 VocabularyTest::providerSource

See also

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

File

core/modules/language/tests/src/Kernel/Plugin/migrate/source/d7/LanguageContentTaxonomyVocabularySettingsTest.php, line 24

Class

LanguageContentTaxonomyVocabularySettingsTest
Tests i18ntaxonomy vocabulary setting source plugin.

Namespace

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

Code

public function providerSource() {

  // Get the source data from parent.
  $tests = parent::providerSource();
  foreach ($tests as &$test) {

    // Add the extra columns provided by i18n_taxonomy.
    foreach ($test['source_data']['taxonomy_vocabulary'] as &$vocabulary) {
      $vocabulary['language'] = 'und';
      $vocabulary['i18n_mode'] = 2;
    }
    foreach ($test['expected_data'] as &$expected) {
      $expected['language'] = 'und';
      $expected['i18n_mode'] = 2;
    }
  }
  return $tests;
}