You are here

protected function SearchConfigSettingsFormTest::verifySearchPageOperations in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php \Drupal\Tests\search\Functional\SearchConfigSettingsFormTest::verifySearchPageOperations()
  2. 10 core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php \Drupal\Tests\search\Functional\SearchConfigSettingsFormTest::verifySearchPageOperations()

Checks that the search page operations match expectations.

Parameters

string $id: The search page ID to check.

bool $edit: Whether the edit link is expected.

bool $delete: Whether the delete link is expected.

bool $disable: Whether the disable link is expected.

bool $enable: Whether the enable link is expected.

1 call to SearchConfigSettingsFormTest::verifySearchPageOperations()
SearchConfigSettingsFormTest::testMultipleSearchPages in core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
Tests multiple search pages of the same type.

File

core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php, line 381

Class

SearchConfigSettingsFormTest
Verify the search config settings form.

Namespace

Drupal\Tests\search\Functional

Code

protected function verifySearchPageOperations($id, $edit, $delete, $disable, $enable) {
  if ($edit) {
    $this
      ->assertSession()
      ->linkByHrefExists("admin/config/search/pages/manage/{$id}");
  }
  else {
    $this
      ->assertSession()
      ->linkByHrefNotExists("admin/config/search/pages/manage/{$id}");
  }
  if ($delete) {
    $this
      ->assertSession()
      ->linkByHrefExists("admin/config/search/pages/manage/{$id}/delete");
  }
  else {
    $this
      ->assertSession()
      ->linkByHrefNotExists("admin/config/search/pages/manage/{$id}/delete");
  }
  if ($disable) {
    $this
      ->assertSession()
      ->linkByHrefExists("admin/config/search/pages/manage/{$id}/disable");
  }
  else {
    $this
      ->assertSession()
      ->linkByHrefNotExists("admin/config/search/pages/manage/{$id}/disable");
  }
  if ($enable) {
    $this
      ->assertSession()
      ->linkByHrefExists("admin/config/search/pages/manage/{$id}/enable");
  }
  else {
    $this
      ->assertSession()
      ->linkByHrefNotExists("admin/config/search/pages/manage/{$id}/enable");
  }
}