Same name and namespace in other branches
- 8.9.x core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php \Drupal\Tests\migrate\Kernel\HighWaterNotJoinableTest
- 9 core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php \Drupal\Tests\migrate\Kernel\HighWaterNotJoinableTest
Tests the high water handling.
@covers \Drupal\migrate_high_water_test\Plugin\migrate\source\HighWaterTest @group migrate
Hierarchy
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
- class \Drupal\Tests\migrate\Kernel\HighWaterNotJoinableTest
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
Expanded class hierarchy of HighWaterNotJoinableTest
File
- core/
modules/ migrate/ tests/ src/ Kernel/ HighWaterNotJoinableTest.php, line 13
Namespace
Drupal\Tests\migrate\KernelView source
class HighWaterNotJoinableTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'migrate',
'migrate_drupal',
'migrate_high_water_test',
];
/**
* {@inheritdoc}
*/
public static function providerSource() {
$tests = [];
// Test high water when the map is not joinable.
// The source data.
$tests[0]['source_data']['high_water_node'] = [
[
'id' => 1,
'title' => 'Item 1',
'changed' => 1,
],
[
'id' => 2,
'title' => 'Item 2',
'changed' => 2,
],
[
'id' => 3,
'title' => 'Item 3',
'changed' => 3,
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'id' => 2,
'title' => 'Item 2',
'changed' => 2,
],
[
'id' => 3,
'title' => 'Item 3',
'changed' => 3,
],
];
// The expected count is the count returned by the query before the query
// is modified by SqlBase::initializeIterator().
$tests[0]['expected_count'] = 3;
$tests[0]['configuration'] = [
'high_water_property' => [
'name' => 'changed',
],
];
$tests[0]['high_water'] = $tests[0]['source_data']['high_water_node'][0]['changed'];
// Test high water initialized to NULL.
$tests[1]['source_data'] = $tests[0]['source_data'];
$tests[1]['expected_data'] = [
[
'id' => 1,
'title' => 'Item 1',
'changed' => 1,
],
[
'id' => 2,
'title' => 'Item 2',
'changed' => 2,
],
[
'id' => 3,
'title' => 'Item 3',
'changed' => 3,
],
];
$tests[1]['expected_count'] = $tests[0]['expected_count'];
$tests[1]['configuration'] = $tests[0]['configuration'];
$tests[1]['high_water'] = NULL;
// Test high water initialized to an empty string.
$tests[2]['source_data'] = $tests[0]['source_data'];
$tests[2]['expected_data'] = [
[
'id' => 1,
'title' => 'Item 1',
'changed' => 1,
],
[
'id' => 2,
'title' => 'Item 2',
'changed' => 2,
],
[
'id' => 3,
'title' => 'Item 3',
'changed' => 3,
],
];
$tests[2]['expected_count'] = $tests[0]['expected_count'];
$tests[2]['configuration'] = $tests[0]['configuration'];
$tests[2]['high_water'] = '';
return $tests;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HighWaterNotJoinableTest:: |
protected static | property |
Overrides MigrateSourceTestBase:: |
|
HighWaterNotJoinableTest:: |
public static | function | ||
MigrateSourceTestBase:: |
protected | property | The mocked migration. | |
MigrateSourceTestBase:: |
protected | property | The source plugin under test. | |
MigrateSourceTestBase:: |
protected | function | Instantiates the source plugin under test. | |
MigrateSourceTestBase:: |
protected | function | Determines the plugin to be tested by reading the class @covers annotation. | |
MigrateSourceTestBase:: |
protected | function | ||
MigrateSqlSourceTestBase:: |
protected | function | Builds an in-memory SQLite database from a set of source data. | |
MigrateSqlSourceTestBase:: |
public | function | ||
MigrateSqlSourceTestBase:: |
public | function |
Tests the source plugin against a particular data set. Overrides MigrateSourceTestBase:: |