Move into nested docroot

This commit is contained in:
Rob Davies 2017-02-13 15:31:17 +00:00
parent 83a0d3a149
commit c8b70abde9
13405 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,67 @@
<?php
namespace Drupal\Tests\tracker\Kernel\Migrate\d7;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
use Drupal\Core\Database\Database;
/**
* Tests migration of tracker_node.
*
* @group tracker
*/
class MigrateTrackerNodeTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'node',
'text',
'tracker',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installEntitySchema('node');
$this->installConfig(static::$modules);
$this->installSchema('node', ['node_access']);
$this->installSchema('tracker', ['tracker_node', 'tracker_user']);
$this->executeMigrations([
'd7_user_role',
'd7_user',
'd7_node_type',
'd7_node',
'd7_tracker_node',
]);
}
/**
* Tests migration of tracker node table.
*/
public function testMigrateTrackerNode() {
$connection = Database::getConnection('default', 'migrate');
$num_rows = $connection
->select('tracker_node', 'tn')
->fields('tn', ['nid', 'published', 'changed'])
->countQuery()
->execute()
->fetchField();
$this->assertIdentical('1', $num_rows);
$tracker_nodes = $connection
->select('tracker_node', 'tn')
->fields('tn', ['nid', 'published', 'changed'])
->execute();
$row = $tracker_nodes->fetchAssoc();
$this->assertIdentical('1', $row['nid']);
$this->assertIdentical('1', $row['published']);
$this->assertIdentical('1421727536', $row['changed']);
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace Drupal\Tests\tracker\Kernel\Migrate\d7;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests migration of Tracker settings to configuration.
*
* @group tracker
*/
class MigrateTrackerSettingsTest extends MigrateDrupal7TestBase {
public static $modules = ['tracker'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(['tracker']);
$this->executeMigration('d7_tracker_settings');
}
/**
* Tests migration of tracker's variables to configuration.
*/
public function testMigration() {
$this->assertIdentical(999, \Drupal::config('tracker.settings')->get('cron_index_limit'));
}
}

View file

@ -0,0 +1,68 @@
<?php
namespace Drupal\Tests\tracker\Kernel\Migrate\d7;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
use Drupal\Core\Database\Database;
/**
* Tests migration of tracker_user.
*
* @group tracker
*/
class MigrateTrackerUserTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'node',
'text',
'tracker',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installEntitySchema('node');
$this->installConfig(static::$modules);
$this->installSchema('node', ['node_access']);
$this->installSchema('tracker', ['tracker_node', 'tracker_user']);
$this->executeMigrations([
'd7_user_role',
'd7_user',
'd7_node_type',
'd7_node',
'd7_tracker_node',
]);
}
/**
* Tests migration of tracker user table.
*/
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']);
}
}

View file

@ -0,0 +1,42 @@
<?php
namespace Drupal\Tests\tracker\Kernel\Plugin\migrate\source\d7;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests D7 tracker node source plugin.
*
* @covers Drupal\tracker\Plugin\migrate\source\d7\TrackerNode
*
* @group tracker
*/
class TrackerNodeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['tracker', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['database']['tracker_node'] = [
[
'nid' => '2',
'published' => '1',
'changed' => '1421727536',
]
];
// The expected results are identical to the source data.
$tests[0]['expected_results'] = $tests[0]['database']['tracker_node'];
return $tests;
}
}

View file

@ -0,0 +1,43 @@
<?php
namespace Drupal\Tests\tracker\Kernel\Plugin\migrate\source\d7;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests D7 tracker user source plugin.
*
* @covers Drupal\tracker\Plugin\migrate\source\d7\TrackerUser
*
* @group tracker
*/
class TrackerUserTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['tracker', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['database']['tracker_user'] = [
[
'nid' => '1',
'uid' => '2',
'published' => '1',
'changed' => '1421727536',
]
];
// The expected results are identical to the source data.
$tests[0]['expected_results'] = $tests[0]['database']['tracker_user'];
return $tests;
}
}