Issue #2343173 by benjy: Fixed HEAD BROKEN: Duplicate entry in migrate dump node_revisions table.
parent
f57fa98616
commit
60dd5c17f2
|
@ -39,7 +39,7 @@ class Drupal6NodeRevision extends Drupal6DumpBase {
|
||||||
))
|
))
|
||||||
->values(array(
|
->values(array(
|
||||||
'nid' => 1,
|
'nid' => 1,
|
||||||
'vid' => 4,
|
'vid' => 5,
|
||||||
'uid' => 1,
|
'uid' => 1,
|
||||||
'title' => 'Test title rev 3',
|
'title' => 'Test title rev 3',
|
||||||
'body' => 'body test rev 3',
|
'body' => 'body test rev 3',
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
namespace Drupal\migrate_drupal\Tests\d6;
|
namespace Drupal\migrate_drupal\Tests\d6;
|
||||||
|
|
||||||
use Drupal\migrate\MigrateExecutable;
|
use Drupal\migrate\MigrateExecutable;
|
||||||
|
use Drupal\migrate_drupal\Tests\Dump\Drupal6User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node content revisions migration.
|
* Node content revisions migration.
|
||||||
|
@ -21,6 +22,12 @@ class MigrateNodeRevisionTest extends MigrateNodeTestBase {
|
||||||
*/
|
*/
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::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(
|
$id_mappings = array(
|
||||||
'd6_node' => array(
|
'd6_node' => array(
|
||||||
array(array(1), array(1)),
|
array(array(1), array(1)),
|
||||||
|
@ -50,11 +57,11 @@ class MigrateNodeRevisionTest extends MigrateNodeTestBase {
|
||||||
$this->assertEqual($node->getTitle(), 'Test title rev 2');
|
$this->assertEqual($node->getTitle(), 'Test title rev 2');
|
||||||
$this->assertEqual($node->body->value, 'body test rev 2');
|
$this->assertEqual($node->body->value, 'body test rev 2');
|
||||||
$this->assertEqual($node->body->summary, 'teaser 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->revision_log->value, 'modified rev 2');
|
||||||
$this->assertEqual($node->getRevisionCreationTime(), '1390095702');
|
$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->id(), 1);
|
||||||
$this->assertEqual($node->body->value, 'body test rev 3');
|
$this->assertEqual($node->body->value, 'body test rev 3');
|
||||||
$this->assertEqual($node->getRevisionAuthor()->id(), 1);
|
$this->assertEqual($node->getRevisionAuthor()->id(), 1);
|
||||||
|
|
Loading…
Reference in New Issue