function MigrateTrackerNodeTest::testMigrateTrackerNode

Same name in other branches
  1. 8.9.x core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerNodeTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerNodeTest::testMigrateTrackerNode()
  2. 10 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerNodeTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerNodeTest::testMigrateTrackerNode()
  3. 11.x core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerNodeTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerNodeTest::testMigrateTrackerNode()

Tests migration of tracker node table.

File

core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerNodeTest.php, line 46

Class

MigrateTrackerNodeTest
Tests migration of tracker_node.

Namespace

Drupal\Tests\tracker\Kernel\Migrate\d7

Code

public function testMigrateTrackerNode() {
    $connection = Database::getConnection('default', 'migrate');
    $num_rows = $connection->select('tracker_node', 'tn')
        ->fields('tn', [
        'nid',
        'published',
        'changed',
    ])
        ->countQuery()
        ->execute()
        ->fetchField();
    $this->assertSame('1', $num_rows);
    $tracker_nodes = $connection->select('tracker_node', 'tn')
        ->fields('tn', [
        'nid',
        'published',
        'changed',
    ])
        ->execute();
    $row = $tracker_nodes->fetchAssoc();
    $this->assertSame('1', $row['nid']);
    $this->assertSame('1', $row['published']);
    $this->assertSame('1421727536', $row['changed']);
}

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