composer update

This commit is contained in:
Oliver Davies 2019-01-24 08:00:03 +00:00
parent f6abc3dce2
commit 71dfaca858
1753 changed files with 45274 additions and 14619 deletions

View file

@ -136,6 +136,72 @@ class HighWaterTest extends MigrateTestBase {
$this->assertNodeDoesNotExist('Item 3');
}
/**
* Tests that the high water value can be 0.
*/
public function testZeroHighwater() {
// Assert all of the nodes have been imported.
$this->assertNodeExists('Item 1');
$this->assertNodeExists('Item 2');
$this->assertNodeExists('Item 3');
$migration = $this->container->get('plugin.manager.migration')->CreateInstance('high_water_test', []);
$source = $migration->getSourcePlugin();
$source->rewind();
$count = 0;
while ($source->valid()) {
$count++;
$source->next();
}
// Expect no rows as everything is below the high water mark.
$this->assertSame(0, $count);
// Test resetting the high water mark to 0.
$this->container->get('keyvalue')->get('migrate:high_water')->set('high_water_test', 0);
$migration = $this->container->get('plugin.manager.migration')->CreateInstance('high_water_test', []);
$source = $migration->getSourcePlugin();
$source->rewind();
$count = 0;
while ($source->valid()) {
$count++;
$source->next();
}
$this->assertSame(3, $count);
}
/**
* Tests that deleting the high water value causes all rows to be reimported.
*/
public function testNullHighwater() {
// Assert all of the nodes have been imported.
$this->assertNodeExists('Item 1');
$this->assertNodeExists('Item 2');
$this->assertNodeExists('Item 3');
$migration = $this->container->get('plugin.manager.migration')->CreateInstance('high_water_test', []);
$source = $migration->getSourcePlugin();
$source->rewind();
$count = 0;
while ($source->valid()) {
$count++;
$source->next();
}
// Expect no rows as everything is below the high water mark.
$this->assertSame(0, $count);
// Test resetting the high water mark.
$this->container->get('keyvalue')->get('migrate:high_water')->delete('high_water_test');
$migration = $this->container->get('plugin.manager.migration')->CreateInstance('high_water_test', []);
$source = $migration->getSourcePlugin();
$source->rewind();
$count = 0;
while ($source->valid()) {
$count++;
$source->next();
}
$this->assertSame(3, $count);
}
/**
* Tests high water property of SqlBase when rows marked for update.
*/

View file

@ -45,6 +45,11 @@ class MigrateEmbeddedDataTest extends KernelTestBase {
$results = [];
/** @var \Drupal\migrate\Row $row */
foreach ($source as $row) {
// The plugin should not mark any rows as stubs. We need to use
// assertSame() here because assertFalse() will pass falsy values (e.g.,
// empty arrays).
$this->assertSame(FALSE, $row->isStub());
$data_row = $row->getSource();
// The "data" row returned by getSource() also includes all source
// configuration - we remove it so we see only the data itself.

View file

@ -529,14 +529,14 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
$this->fail('Too many source IDs should throw');
}
catch (MigrateException $e) {
$this->assertEquals("Extra unknown items in source IDs: array (\n 0 => 3,\n)", $e->getMessage());
$this->assertEquals("Extra unknown items for map migrate_map_sql_idmap_test in source IDs: array (\n 0 => 3,\n)", $e->getMessage());
}
try {
$id_map->lookupDestinationIds(['nid' => 1, 'aaa' => '2']);
$this->fail('Unknown source ID key should throw');
}
catch (MigrateException $e) {
$this->assertEquals("Extra unknown items in source IDs: array (\n 'aaa' => '2',\n)", $e->getMessage());
$this->assertEquals("Extra unknown items for map migrate_map_sql_idmap_test in source IDs: array (\n 'aaa' => '2',\n)", $e->getMessage());
}
// Verify that we are looking up by source_id_hash when all source IDs are

View file

@ -175,6 +175,42 @@ class FormatDateTest extends MigrateProcessTestCase {
// converted from Australia/Sydney to America/Managua timezone.
'expected' => '2004-12-18 17:19:42 America/Managua',
],
'integer_0' => [
'configuration' => [
'from_format' => 'U',
'to_format' => 'Y-m-d',
],
'value' => 0,
'expected' => '1970-01-01',
],
'string_0' => [
'configuration' => [
'from_format' => 'U',
'to_format' => 'Y-m-d',
],
'value' => '0',
'expected' => '1970-01-01',
],
'zeros' => [
'configuration' => [
'from_format' => 'Y-m-d H:i:s',
'to_format' => 'Y-m-d H:i:s e',
'settings' => ['validate_format' => FALSE],
],
'value' => '0000-00-00 00:00:00',
'expected' => '-0001-11-30 00:00:00 Australia/Sydney',
],
'zeros_same_timezone' => [
'configuration' => [
'from_format' => 'Y-m-d H:i:s',
'to_format' => 'Y-m-d H:i:s',
'settings' => ['validate_format' => FALSE],
'from_timezone' => 'UTC',
'to_timezone' => 'UTC',
],
'value' => '0000-00-00 00:00:00',
'expected' => '-0001-11-30 00:00:00',
],
];
}