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,182 @@
langcode: en
status: true
dependencies:
module:
- node
- tracker
- user
id: test_tracker_user_uid
label: 'tracker test'
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: null
display_options:
access:
type: perm
cache:
type: tag
query:
type: views_query
exposed_form:
type: basic
pager:
type: full
style:
type: table
options:
grouping: { }
row_class: ''
default_row_class: true
override: true
sticky: false
summary: ''
columns:
title: title
info:
title:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
default: '-1'
empty_table: false
row:
type: fields
fields:
title:
id: title
table: node_field_data
field: title
relationship: none
group_type: group
admin_label: ''
label: Title
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: false
ellipsis: false
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
plugin_id: field
entity_type: node
entity_field: title
filters:
uid_touch_tracker:
id: uid_touch_tracker
table: node_field_data
field: uid_touch_tracker
relationship: none
group_type: group
admin_label: ''
operator: in
value:
- '0'
group: 1
exposed: false
expose:
operator_id: ''
label: 'User posted or commented'
description: ''
use_operator: false
operator: uid_touch_tracker_op
identifier: uid_touch_tracker
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: tracker_user_uid
entity_type: node
arguments:
uid_touch_tracker:
id: uid_touch_tracker
table: node_field_data
field: uid_touch_tracker
relationship: none
group_type: group
admin_label: ''
default_action: ignore
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
plugin_id: tracker_user_uid
entity_type: node

View file

@ -0,0 +1,9 @@
name: 'Tracker test views'
type: module
description: 'Provides default views for views tracker tests.'
package: Testing
version: VERSION
core: 8.x
dependencies:
- tracker
- views

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;
}
}