function ContentImportTest::testImportEntityThatAlreadyExists

Same name and namespace in other branches
  1. 10 core/tests/Drupal/FunctionalTests/DefaultContent/ContentImportTest.php \Drupal\FunctionalTests\DefaultContent\ContentImportTest::testImportEntityThatAlreadyExists()

@dataProvider providerImportEntityThatAlreadyExists

File

core/tests/Drupal/FunctionalTests/DefaultContent/ContentImportTest.php, line 125

Class

ContentImportTest
@covers <a href="/api/drupal/core%21lib%21Drupal%21Core%21DefaultContent%21Importer.php/class/Importer/11.x" title="A service for handling import of content." class="local">\Drupal\Core\DefaultContent\Importer</a> @group DefaultContent @group Recipe

Namespace

Drupal\FunctionalTests\DefaultContent

Code

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.