function MigrateNodeCompleteTest::testNodeCompleteMigration

Same name in this branch
  1. 10 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeCompleteTest::testNodeCompleteMigration()
Same name in other branches
  1. 9 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeCompleteTest::testNodeCompleteMigration()
  2. 9 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeCompleteTest::testNodeCompleteMigration()
  3. 8.9.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeCompleteTest::testNodeCompleteMigration()
  4. 8.9.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeCompleteTest::testNodeCompleteMigration()
  5. 11.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeCompleteTest::testNodeCompleteMigration()
  6. 11.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeCompleteTest::testNodeCompleteMigration()

Tests the complete node migration.

File

core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php, line 61

Class

MigrateNodeCompleteTest
Test class for a complete node migration for Drupal 6.

Namespace

Drupal\Tests\node\Kernel\Migrate\d6

Code

public function testNodeCompleteMigration() : void {
    $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')
        ->fields('nr')
        ->orderBy('nid')
        ->orderBy('vid')
        ->orderBy('langcode')
        ->execute()
        ->fetchAll(\PDO::FETCH_ASSOC));
    // Now load and test each revision, including the field 'field_text_plain'
    // which has text reflecting the revision.
    $data = $this->expectedRevisionEntityData()[0];
    foreach ($this->expectedNodeFieldRevisionTable() as $key => $revision) {
        $this->assertRevision($revision, $data[$key]);
    }
    // Test the order in multi-value fields.
    $revision = $this->nodeStorage
        ->loadRevision(21);
    $this->assertSame([
        [
            'target_id' => '15',
        ],
        [
            'target_id' => '16',
        ],
    ], $revision->get('field_company')
        ->getValue());
}

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