25544486ab2862e5f72f49f030b2928c6084ba33
[yaffs-website] / web / core / modules / taxonomy / tests / src / Kernel / Migrate / d6 / MigrateTermNodeRevisionTest.php
1 <?php
2
3 namespace Drupal\Tests\taxonomy\Kernel\Migrate\d6;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
6
7 /**
8  * Upgrade taxonomy term node associations.
9  *
10  * @group migrate_drupal_6
11  */
12 class MigrateTermNodeRevisionTest extends MigrateDrupal6TestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['taxonomy', 'menu_ui'];
18
19   /**
20    * {@inheritdoc}
21    */
22   protected function setUp() {
23     parent::setUp();
24     $this->installSchema('node', ['node_access']);
25     $this->migrateContent(['revisions']);
26     $this->migrateTaxonomy();
27     $this->executeMigrations(['d6_term_node', 'd6_term_node_revision']);
28   }
29
30   /**
31    * Tests the Drupal 6 term-node revision association to Drupal 8 migration.
32    */
33   public function testTermRevisionNode() {
34     $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2001);
35     $this->assertSame(2, count($node->field_vocabulary_3_i_2_));
36     $this->assertSame('4', $node->field_vocabulary_3_i_2_[0]->target_id);
37     $this->assertSame('5', $node->field_vocabulary_3_i_2_[1]->target_id);
38   }
39
40 }