Issue #2343173 by benjy: Fixed HEAD BROKEN: Duplicate entry in migrate dump node_revisions table.

8.0.x
Alex Pott 2014-09-23 09:38:27 +01:00
parent f57fa98616
commit 60dd5c17f2
2 changed files with 10 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Drupal6NodeRevision extends Drupal6DumpBase {
))
->values(array(
'nid' => 1,
'vid' => 4,
'vid' => 5,
'uid' => 1,
'title' => 'Test title rev 3',
'body' => 'body test rev 3',

View File

@ -8,6 +8,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\Dump\Drupal6User;
/**
* Node content revisions migration.
@ -21,6 +22,12 @@ class MigrateNodeRevisionTest extends MigrateNodeTestBase {
*/
protected function setUp() {
parent::setUp();
// Create our users for the node authors.
foreach (Drupal6User::getData('users') as $u) {
$user = entity_create('user', $u);
$user->enforceIsNew();
$user->save();
}
$id_mappings = array(
'd6_node' => array(
array(array(1), array(1)),
@ -50,11 +57,11 @@ class MigrateNodeRevisionTest extends MigrateNodeTestBase {
$this->assertEqual($node->getTitle(), 'Test title rev 2');
$this->assertEqual($node->body->value, 'body test rev 2');
$this->assertEqual($node->body->summary, 'teaser test rev 2');
$this->assertEqual($node->getRevisionAuthor()->id(), 1);
$this->assertEqual($node->getRevisionAuthor()->id(), 2);
$this->assertEqual($node->revision_log->value, 'modified rev 2');
$this->assertEqual($node->getRevisionCreationTime(), '1390095702');
$node = \Drupal::entityManager()->getStorage('node')->loadRevision(4);
$node = \Drupal::entityManager()->getStorage('node')->loadRevision(5);
$this->assertEqual($node->id(), 1);
$this->assertEqual($node->body->value, 'body test rev 3');
$this->assertEqual($node->getRevisionAuthor()->id(), 1);