You are here

public function MigrateTrackerNodeTest::testMigrateTrackerNode in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerNodeTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerNodeTest::testMigrateTrackerNode()
  2. 9 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']);
}