You are here

public function ArrayBuildTest::testNonExistentKey in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php \Drupal\Tests\migrate\Unit\process\ArrayBuildTest::testNonExistentKey()
  2. 10 core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php \Drupal\Tests\migrate\Unit\process\ArrayBuildTest::testNonExistentKey()

Tests non-existent key for the key configuration.

File

core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php, line 45

Class

ArrayBuildTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\ArrayBuild @group migrate

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testNonExistentKey() {
  $source = [
    [
      'bar' => 'foo',
    ],
  ];
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage("The key 'foo' does not exist");
  $this->plugin
    ->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
}