You are here

public function MigrateTrackerUserTest::testMigrateTrackerUser in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerUserTest.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateTrackerUserTest::testMigrateTrackerUser()
  2. 10 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 47

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
    ->assertIdentical('1', $num_rows);
  $tracker_nodes = $connection
    ->select('tracker_user', 'tu')
    ->fields('tu', [
    'nid',
    'uid',
    'published',
    'changed',
  ])
    ->execute();
  $row = $tracker_nodes
    ->fetchAssoc();
  $this
    ->assertIdentical('1', $row['nid']);
  $this
    ->assertIdentical('2', $row['uid']);
  $this
    ->assertIdentical('1', $row['published']);
  $this
    ->assertIdentical('1421727536', $row['changed']);
}