Update to Drupal 8.1.9. For more information, see https://www.drupal.org/project/drupal/releases/8.1.9

This commit is contained in:
Pantheon Automation 2016-09-07 13:26:21 -07:00 committed by Greg Anderson
parent f9f23cdf38
commit 09b113657a
125 changed files with 2307 additions and 385 deletions

View file

@ -128,6 +128,9 @@ class MigrateRollbackTest extends MigrateTestBase {
$this->assertNotNull($map_row['destid1']);
}
// Add a failed row to test if this can be rolled back without errors.
$this->mockFailure($term_migration, ['id' => '4', 'vocab' => '2', 'name' => 'FAIL']);
// Rollback and verify the entities are gone.
$term_executable->rollback();
foreach ($term_data_rows as $row) {

View file

@ -640,6 +640,35 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
$this->assertSame(0, count($source_id));
}
/**
* Tests currentDestination() and currentSource().
*/
public function testCurrentDestinationAndSource() {
// Simple map with one source and one destination ID.
$id_map = $this->setupRows(['nid'], ['nid'], [
[1, 101],
[2, 102],
[3, 103],
// Mock a failed row by setting the destination ID to NULL.
[4, NULL],
]);
// The rows are ordered by destination ID so the failed row should be first.
$id_map->rewind();
$this->assertEquals([], $id_map->currentDestination());
$this->assertEquals(['nid' => 4], $id_map->currentSource());
$id_map->next();
$this->assertEquals(['nid' => 101], $id_map->currentDestination());
$this->assertEquals(['nid' => 1], $id_map->currentSource());
$id_map->next();
$this->assertEquals(['nid' => 102], $id_map->currentDestination());
$this->assertEquals(['nid' => 2], $id_map->currentSource());
$id_map->next();
$this->assertEquals(['nid' => 103], $id_map->currentDestination());
$this->assertEquals(['nid' => 3], $id_map->currentSource());
$id_map->next();
}
/**
* Tests the imported count method.
*