nodeMigrateMapTableCount example


  public function testNodeClassicUpgrade() {
    // Add a node classic migrate table to d8.     $this->makeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '6');

    // Start the upgrade process.     $this->submitCredentialForm();

    // Confirm there are only classic node migration map tables. This shows     // that only the classic migration will run.     $results = $this->nodeMigrateMapTableCount('6');
    $this->assertSame(14, $results['node']);
    $this->assertSame(0, $results['node_complete']);
  }

}
'd6_node',
      'd6_node_translation',
    ]);
  }

  /** * Tests node migration from Drupal 6 to 8. */
  public function testNode() {
    // Confirm there are only classic node migration map tables. This shows     // that only the classic migration ran.     $results = $this->nodeMigrateMapTableCount('6');
    $this->assertSame(14, $results['node']);
    $this->assertSame(0, $results['node_complete']);
    $node = Node::load(1);
    $this->assertSame('1', $node->id(), 'Node 1 loaded.');
    $this->assertSame('und', $node->langcode->value);
    $this->assertSame('body test rev 3', $node->body->value);
    $this->assertSame('teaser test rev 3', $node->body->summary);
    $this->assertSame('filtered_html', $node->body->format);
    $this->assertSame('story', $node->getType(), 'Node has the correct bundle.');
    $this->assertSame('Test title rev 3', $node->getTitle(), 'Node has the correct title.');
    $this->assertSame('1390095702', $node->getCreatedTime(), 'Node has the correct created time.');
    
'base_path' => 'public://',
      'plugin_id' => 'd7_file',
    ];
  }

  /** * Tests the complete node migration. */
  public function testNodeCompleteMigration() {
    // Confirm there are only complete node migration map tables. This shows     // that only the complete migration ran.     $results = $this->nodeMigrateMapTableCount('7');
    $this->assertSame(0, $results['node']);
    $this->assertSame(8, $results['node_complete']);

    $db = \Drupal::database();
    $this->assertEquals($this->expectedNodeFieldRevisionTable()$db->select('node_field_revision', 'nr')
      ->fields('nr')
      ->orderBy('vid')
      ->orderBy('langcode')
      ->execute()
      ->fetchAll(\PDO::FETCH_ASSOC));
    $this->assertEquals($this->expectedNodeFieldDataTable()$db->select('node_field_data', 'nr')
      
$this->assertEquals($uid$revision->getRevisionUser()->id());
    $this->assertEquals($log$revision->revision_log->value);
    $this->assertEquals($timestamp$revision->getRevisionCreationTime());
  }

  /** * Tests node migration from Drupal 7 to 8. */
  public function testNode() {
    // Confirm there are only classic node migration map tables. This shows     // that only the classic migration ran.     $results = $this->nodeMigrateMapTableCount('7');
    $this->assertSame(9, $results['node']);
    $this->assertSame(0, $results['node_complete']);

    $this->assertEntity(1, 'test_content_type', 'en', 'An English Node', '2', TRUE, '1421727515', '1441032132', TRUE, FALSE);
    $this->assertRevision(1, 'An English Node', '1', NULL, '1441032132');

    $node = Node::load(1);
    $this->assertNotEmpty($node->field_boolean->value);
    $this->assertEquals('99-99-99-99', $node->field_phone->value);
    $this->assertSame('2015-01-20T04:15:00', $node->field_date->value);
    $this->assertSame('2015-01-20', $node->field_date_without_time->value);
    
Home | Imprint | This part of the site doesn't use cookies.