You are here

public function MigrateNodeTest::testNode in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php \Drupal\node\Tests\Migrate\d6\MigrateNodeTest::testNode()
  2. 8 core/modules/node/src/Tests/Migrate/d7/MigrateNodeTest.php \Drupal\node\Tests\Migrate\d7\MigrateNodeTest::testNode()
Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/Migrate/d7/MigrateNodeTest.php \Drupal\node\Tests\Migrate\d7\MigrateNodeTest::testNode()

Test node migration from Drupal 7 to 8.

File

core/modules/node/src/Tests/Migrate/d7/MigrateNodeTest.php, line 124
Contains \Drupal\node\Tests\Migrate\d7\MigrateNodeTest.

Class

MigrateNodeTest
Tests node migration.

Namespace

Drupal\node\Tests\Migrate\d7

Code

public function testNode() {
  $this
    ->assertEntity(1, 'test_content_type', 'en', 'A Node', '2', TRUE, '1421727515', '1441032132', TRUE, FALSE);
  $this
    ->assertRevision(1, 'A Node', '1', NULL, '1441032132');
  $node = Node::load(1);
  $this
    ->assertTrue($node->field_boolean->value);
  $this
    ->assertIdentical('99-99-99-99', $node->field_phone->value);

  // Use assertEqual() here instead, since SQLite interprets floats strictly.
  $this
    ->assertEqual('1', $node->field_float->value);
  $this
    ->assertIdentical('5', $node->field_integer->value);
  $this
    ->assertIdentical('Some more text', $node->field_text_list[0]->value);
  $this
    ->assertIdentical('7', $node->field_integer_list[0]->value);
  $this
    ->assertIdentical('qwerty', $node->field_text->value);
}