You are here

public function RowTest::testDestination in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::testDestination()

Tests setting and getting the destination.

File

core/modules/migrate/tests/src/Unit/RowTest.php, line 219
Contains \Drupal\Tests\migrate\Unit\RowTest.

Class

RowTest
@coversDefaultClass \Drupal\migrate\Row @group migrate

Namespace

Drupal\Tests\migrate\Unit

Code

public function testDestination() {
  $row = new Row($this->testValues, $this->testSourceIds);
  $this
    ->assertEmpty($row
    ->getDestination());
  $this
    ->assertFalse($row
    ->hasDestinationProperty('nid'));

  // Set a destination.
  $row
    ->setDestinationProperty('nid', 2);
  $this
    ->assertTrue($row
    ->hasDestinationProperty('nid'));
  $this
    ->assertEquals(array(
    'nid' => 2,
  ), $row
    ->getDestination());
}