You are here

public function OliveroTest::testConfigSchema in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php \Drupal\FunctionalTests\Theme\OliveroTest::testConfigSchema()

Test Olivero's configuration schema.

File

core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php, line 47

Class

OliveroTest
Tests the Olivero theme.

Namespace

Drupal\FunctionalTests\Theme

Code

public function testConfigSchema() {

  // Required configuration.
  $this
    ->drupalGet('');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->elementExists('css', '#block-olivero-content');
  $this
    ->assertSession()
    ->elementNotExists('css', '#block-olivero-search-form-wide');

  // Optional configuration.
  \Drupal::service('module_installer')
    ->install([
    'search',
    'image',
    'book',
    'help',
    'node',
  ]);
  $this
    ->rebuildAll();
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'search content',
  ]));

  // Confirm search block was installed.
  $this
    ->assertSession()
    ->elementExists('css', '#block-olivero-search-form-wide');
}