function StandardRecipeInstallTest::testStandard

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Core/Recipe/StandardRecipeInstallTest.php \Drupal\FunctionalTests\Core\Recipe\StandardRecipeInstallTest::testStandard()
  2. 10 core/tests/Drupal/FunctionalTests/Core/Recipe/StandardRecipeInstallTest.php \Drupal\FunctionalTests\Core\Recipe\StandardRecipeInstallTest::testStandard()

File

core/tests/Drupal/FunctionalTests/Core/Recipe/StandardRecipeInstallTest.php, line 62

Class

StandardRecipeInstallTest
Tests installing the Standard recipe via the installer.

Namespace

Drupal\FunctionalTests\Core\Recipe

Code

public function testStandard() : void {
  if (!isset($this->rootUser->passRaw) && isset($this->rootUser->pass_raw)) {
    $this->rootUser->passRaw = $this->rootUser->pass_raw;
  }
  // These recipes provide functionality that is only optionally part of the
  // Standard profile, so we need to explicitly apply them.
  $this->applyRecipe('core/recipes/editorial_workflow');
  $this->applyRecipe('core/recipes/audio_media_type');
  $this->applyRecipe('core/recipes/document_media_type');
  $this->applyRecipe('core/recipes/image_media_type');
  $this->applyRecipe('core/recipes/local_video_media_type');
  $this->applyRecipe('core/recipes/remote_video_media_type');
  // Add a Home link to the main menu as Standard expects "Main navigation"
  // block on the page.
  $this->drupalGet('admin/structure/menu/manage/main/add');
  $this->submitForm([
    'title[0][value]' => 'Home',
    'link[0][uri]' => '<front>',
  ], 'Save');
  // Standard ships two shortcuts; ensure they exist.
  $this->assertCount(2, Shortcut::loadMultiple());
  // The installer logs you in.
  $this->drupalLogout();
  $this->doTestStandard();
}

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