You are here

public function EntityContentBaseTest::testImportEntityLoadFailure in Zircon Profile 8

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

Test row skipping when we can't get an entity to save.

@covers ::import @expectedException \Drupal\migrate\MigrateException @expectedExceptionMessage Unable to get entity

File

core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php, line 88
Contains \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityContentBaseTest

Class

EntityContentBaseTest
Tests base entity migration destination functionality.

Namespace

Drupal\Tests\migrate\Unit\Plugin\migrate\destination

Code

public function testImportEntityLoadFailure() {
  $bundles = [];
  $destination = new EntityTestDestination([], '', [], $this->migration
    ->reveal(), $this->storage
    ->reveal(), $bundles, $this->entityManager
    ->reveal(), $this
    ->prophesize(FieldTypePluginManagerInterface::class)
    ->reveal());
  $destination
    ->setEntity(FALSE);
  $destination
    ->import(new Row([], []));
}