function ContentImportTest::testImportEntityThatAlreadyExists
Tests import entity that already exists.
Attributes
#[DataProvider('providerImportEntityThatAlreadyExists')]
File
-
core/
tests/ Drupal/ FunctionalTests/ DefaultContent/ ContentImportTest.php, line 113
Class
- ContentImportTest
- Tests Content Import.
Namespace
Drupal\FunctionalTests\DefaultContentCode
public function testImportEntityThatAlreadyExists(Existing $existing) : void {
$this->drupalCreateUser(values: [
'uuid' => '94503467-be7f-406c-9795-fc25baa22203',
]);
if ($existing === Existing::Error) {
$this->expectException(ImportException::class);
$this->expectExceptionMessage('user 94503467-be7f-406c-9795-fc25baa22203 already exists.');
}
$this->container
->get(Importer::class)
->importContent(new Finder($this->contentDir), $existing);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.