class TermTranslationTest
Same name in this branch
- 9 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermTranslationTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7\TermTranslationTest
- 9 core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php \Drupal\Tests\taxonomy\Functional\TermTranslationTest
Same name and namespace in other branches
- 11.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/TermTranslationTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6\TermTranslationTest
- 11.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermTranslationTest.php \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7\TermTranslationTest
- 11.x core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php \Drupal\Tests\taxonomy\Functional\TermTranslationTest
Tests taxonomy term source plugin.
@covers \Drupal\taxonomy\Plugin\migrate\source\d6\Term
@group taxonomy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase implements \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase
- class \Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6\TermTranslationTest implements \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase implements \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of TermTranslationTest
File
-
core/
modules/ taxonomy/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d6/ TermTranslationTest.php, line 13
Namespace
Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d6View source
class TermTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'taxonomy',
'migrate_drupal',
];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['term_data'] = [
[
'tid' => 1,
'vid' => 5,
'name' => 'name value 1',
'description' => 'description value 1',
'weight' => 0,
'language' => NULL,
'trid' => 0,
],
[
'tid' => 2,
'vid' => 6,
'name' => 'name value 2',
'description' => 'description value 2',
'weight' => 0,
'language' => NULL,
'trid' => 0,
],
[
'tid' => 3,
'vid' => 6,
'name' => 'name value 3',
'description' => 'description value 3',
'weight' => 0,
'language' => NULL,
'trid' => 0,
],
[
'tid' => 4,
'vid' => 5,
'name' => 'name value 4',
'description' => 'description value 4',
'weight' => 1,
'language' => NULL,
'trid' => 0,
],
[
'tid' => 5,
'vid' => 6,
'name' => 'name value 5',
'description' => 'description value 5',
'weight' => 1,
'language' => NULL,
'trid' => 0,
],
[
'tid' => 6,
'vid' => 6,
'name' => 'name value 6',
'description' => 'description value 6',
'weight' => 0,
'language' => NULL,
'trid' => 0,
],
[
'tid' => 10,
'vid' => 6,
'name' => 'zu - name value 2',
'description' => 'zu - description value 2',
'weight' => 0,
'language' => 'zu',
'trid' => 0,
],
];
$tests[0]['source_data']['term_hierarchy'] = [
[
'tid' => 1,
'parent' => 0,
],
[
'tid' => 2,
'parent' => 0,
],
[
'tid' => 3,
'parent' => 0,
],
[
'tid' => 4,
'parent' => 1,
],
[
'tid' => 5,
'parent' => 2,
],
[
'tid' => 6,
'parent' => 3,
],
[
'tid' => 6,
'parent' => 2,
],
[
'tid' => 10,
'parent' => 0,
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'tid' => 1,
'vid' => 5,
'name' => 'name value 1',
'description' => 'description value 1',
'weight' => 0,
'parent' => [
0,
],
'language' => NULL,
'trid' => 0,
],
[
'tid' => 10,
'vid' => 6,
'name' => 'zu - name value 2',
'description' => 'zu - description value 2',
'weight' => 0,
'parent' => [
0,
],
'language' => 'zu',
'trid' => 0,
],
[
'tid' => 2,
'vid' => 6,
'name' => 'name value 2',
'description' => 'description value 2',
'weight' => 0,
'parent' => [
0,
],
'language' => NULL,
'trid' => 0,
],
[
'tid' => 3,
'vid' => 6,
'name' => 'name value 3',
'description' => 'description value 3',
'weight' => 0,
'parent' => [
0,
],
'language' => NULL,
'trid' => 0,
],
[
'tid' => 4,
'vid' => 5,
'name' => 'name value 4',
'description' => 'description value 4',
'weight' => 1,
'parent' => [
1,
],
'language' => NULL,
'trid' => 0,
],
[
'tid' => 5,
'vid' => 6,
'name' => 'name value 5',
'description' => 'description value 5',
'weight' => 1,
'parent' => [
2,
],
'language' => NULL,
'trid' => 0,
],
[
'tid' => 6,
'vid' => 6,
'name' => 'name value 6',
'description' => 'description value 6',
'weight' => 0,
'parent' => [
3,
2,
],
'language' => NULL,
'trid' => 0,
],
];
$tests[0]['expected_count'] = NULL;
return $tests;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.