function ContentExportTest::setUp

Overrides BrowserTestBase::setUp

File

core/tests/Drupal/FunctionalTests/DefaultContent/ContentExportTest.php, line 54

Class

ContentExportTest
Tests exporting content in YAML format.

Namespace

Drupal\FunctionalTests\DefaultContent

Code

protected function setUp() : void {
  parent::setUp();
  // Apply the recipe that sets up the fields and configuration for our
  // default content.
  $fixtures_dir = $this->getDrupalRoot() . '/core/tests/fixtures';
  $this->applyRecipe($fixtures_dir . '/recipes/default_content_base');
  // We need an administrative user to import and export content.
  $this->adminUser = $this->setUpCurrentUser(admin: TRUE);
  // Import all of the default content from the fixture.
  $this->contentDir = $fixtures_dir . '/default_content';
  $this->finder = new Finder($this->contentDir);
  $this->assertNotEmpty($this->finder->data);
  $this->container
    ->get(Importer::class)
    ->importContent($this->finder);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.