function NodeMigrateTypeTestTrait::nodeMigrateMapTableCount

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait::nodeMigrateMapTableCount()
  2. 10 core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait::nodeMigrateMapTableCount()
  3. 11.x core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait::nodeMigrateMapTableCount()

Gets the numbers of complete and classic node migrate_map tables.

Parameters

string $version: The source database version.

Return value

array An associative array with the total number of complete and classic node migrate_map tables.

4 calls to NodeMigrateTypeTestTrait::nodeMigrateMapTableCount()
MigrateNodeCompleteTest::testNodeCompleteMigration in core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php
Tests the complete node migration.
MigrateNodeTest::testNode in core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
Test node migration from Drupal 6 to 8.
MigrateNodeTest::testNode in core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
Test node migration from Drupal 7 to 8.
NodeClassicTest::testMigrateUpgradeExecute in core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
Tests ID Conflict form.

File

core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php, line 29

Class

NodeMigrateTypeTestTrait
Helper functions to test complete and classic node migrations.

Namespace

Drupal\Tests\migrate_drupal\Traits

Code

protected function nodeMigrateMapTableCount($version) {
    $results = [];
    $bases = [
        'node',
        'node_complete',
    ];
    $tables = \Drupal::database()->schema()
        ->findTables('migrate_map_d' . $version . '_node%');
    foreach ($bases as $base) {
        $base_tables = preg_grep('/^migrate_map_d' . $version . '_' . $base . '_{2}.*$/', $tables);
        $results[$base] = count($base_tables);
    }
    return $results;
}

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