You are here

public function MigrateTrackerUserTest::testMigrateTrackerUser in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerUserTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerUserTest::testMigrateTrackerUser()
  2. 9 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerUserTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerUserTest::testMigrateTrackerUser()

Tests migration of tracker user table.

File

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

Class

MigrateTrackerUserTest
Tests migration of tracker_user.

Namespace

Drupal\Tests\tracker\Kernel\Migrate\d7

Code

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