Commit 99aac33c authored by catch's avatar catch

Issue #2557557 by erozqba, quietone, cebasqueira, phenaproxima: Move old CCK...

Issue #2557557 by erozqba, quietone, cebasqueira, phenaproxima: Move old CCK assertions into MigrateNodeTest
parent 8ec7fdc8
......@@ -57,6 +57,8 @@ public function testNode() {
$node_revision = \Drupal::entityManager()->getStorage('node')->loadRevision(1);
$this->assertIdentical('Test title', $node_revision->getTitle());
$this->assertIdentical('1', $node_revision->getRevisionUser()->id(), 'Node revision has the correct user');
$this->assertSame('1', $node_revision->id(), 'Node 1 loaded.');
$this->assertSame('1', $node_revision->getRevisionId(), 'Node 1 revision 1 loaded.');
// This is empty on the first revision.
$this->assertIdentical(NULL, $node_revision->revision_log->value);
$this->assertIdentical('This is a shared text field', $node->field_test->value);
......@@ -89,6 +91,20 @@ public function testNode() {
$this->assertIdentical('Drupal Groups', $node->field_test_link->title);
$this->assertIdentical([], $node->field_test_link->options['attributes']);
$node = Node::load(3);
// Test multivalue field.
$value_1 = $node->field_multivalue->value;
$value_2 = $node->field_multivalue[1]->value;
// SQLite does not support scales for float data types so we need to convert
// the value manually.
if ($this->container->get('database')->driver() == 'sqlite') {
$value_1 = sprintf('%01.2f', $value_1);
$value_2 = sprintf('%01.2f', $value_2);
}
$this->assertSame('33.00', $value_1);
$this->assertSame('44.00', $value_2);
// Test that a link field with an internal link is migrated.
$node = Node::load(9);
$this->assertSame('internal:/node/10', $node->field_test_link->uri);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment