public function EntityContentBaseTest::testImportEntityLoadFailure in Drupal 8
Same name and namespace in other branches
- 9 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
File
- core/
modules/ migrate/ tests/ src/ Unit/ Plugin/ migrate/ destination/ EntityContentBaseTest.php, line 59 - Contains \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityContentBaseTest
Class
- EntityContentBaseTest
- Tests base entity migration destination functionality.
Namespace
Drupal\Tests\migrate\Unit\Plugin\migrate\destinationCode
public function testImportEntityLoadFailure() {
$bundles = [];
$destination = new EntityTestDestination([], '', [], $this->migration
->reveal(), $this->storage
->reveal(), $bundles, $this->entityFieldManager
->reveal(), $this
->prophesize(FieldTypePluginManagerInterface::class)
->reveal());
$destination
->setEntity(FALSE);
$this
->expectException(MigrateException::class);
$this
->expectExceptionMessage('Unable to get entity');
$destination
->import(new Row());
}