function TermSourceWithVocabularyFilterTest::providerSource

Same name in this branch
  1. 8.9.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6\TermSourceWithVocabularyFilterTest::providerSource()
Same name and namespace in other branches
  1. 9 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6\TermSourceWithVocabularyFilterTest::providerSource()
  2. 9 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7\TermSourceWithVocabularyFilterTest::providerSource()
  3. 10 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6\TermSourceWithVocabularyFilterTest::providerSource()
  4. 10 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7\TermSourceWithVocabularyFilterTest::providerSource()
  5. 11.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6\TermSourceWithVocabularyFilterTest::providerSource()
  6. 11.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermSourceWithVocabularyFilterTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7\TermSourceWithVocabularyFilterTest::providerSource()

Overrides TermTest::providerSource

File

core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermSourceWithVocabularyFilterTest.php, line 21

Class

TermSourceWithVocabularyFilterTest
Tests the taxonomy term source with vocabulary filter.

Namespace

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

Code

public function providerSource() {
  // Get the source data from parent.
  $tests = parent::providerSource();
  // The expected results.
  $tests[0]['expected_data'] = [
    [
      'tid' => 1,
      'vid' => 5,
      'name' => 'name value 1 (name_field)',
      'description' => 'description value 1 (description_field)',
      'weight' => 0,
      'parent' => [
        0,
      ],
    ],
    [
      'tid' => 4,
      'vid' => 5,
      'name' => 'name value 4 (name_field)',
      'description' => 'description value 4 (description_field)',
      'weight' => 1,
      'parent' => [
        1,
      ],
    ],
  ];
  // We know there are two rows with machine_name == 'tags'.
  $tests[0]['expected_count'] = 2;
  // Set up source plugin configuration.
  $tests[0]['configuration'] = [
    'bundle' => [
      'tags',
    ],
  ];
  return $tests;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.