You are here

protected function SearchConfigSettingsFormTest::verifySearchPageOperations in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/src/Tests/SearchConfigSettingsFormTest.php \Drupal\search\Tests\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/src/Tests/SearchConfigSettingsFormTest.php
Tests multiple search pages of the same type.

File

core/modules/search/src/Tests/SearchConfigSettingsFormTest.php, line 337
Contains \Drupal\search\Tests\SearchConfigSettingsFormTest.

Class

SearchConfigSettingsFormTest
Verify the search config settings form.

Namespace

Drupal\search\Tests

Code

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