function ContentImportTest::testImportEntityThatAlreadyExists

Same name in other branches
  1. 11.x 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 \Drupal\Core\DefaultContent\Importer @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.