3 namespace Drupal\Tests\tracker\Kernel\Migrate\d7;
5 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
6 use Drupal\Core\Database\Database;
9 * Tests migration of tracker_user.
13 class MigrateTrackerUserTest extends MigrateDrupal7TestBase {
18 public static $modules = [
28 protected function setUp() {
31 $this->installEntitySchema('node');
32 $this->installConfig(static::$modules);
33 $this->installSchema('node', ['node_access']);
34 $this->installSchema('tracker', ['tracker_node', 'tracker_user']);
36 $this->executeMigrations([
46 * Tests migration of tracker user table.
48 public function testMigrateTrackerUser() {
49 $connection = Database::getConnection('default', 'migrate');
50 $num_rows = $connection
51 ->select('tracker_user', 'tn')
52 ->fields('tu', ['nid', 'uid', 'published', 'changed'])
56 $this->assertIdentical('1', $num_rows);
58 $tracker_nodes = $connection
59 ->select('tracker_user', 'tu')
60 ->fields('tu', ['nid', 'uid', 'published', 'changed'])
62 $row = $tracker_nodes->fetchAssoc();
63 $this->assertIdentical('1', $row['nid']);
64 $this->assertIdentical('2', $row['uid']);
65 $this->assertIdentical('1', $row['published']);
66 $this->assertIdentical('1421727536', $row['changed']);