You are here

public function AcquiaConnectorSearchTest::testEnvironmentUi in Acquia Search 2.x

Tests Environment UI.

Tests that the Acquia Search environment shows up in the interface and that administrators cannot delete it.

Tests executed:

  • Acquia Search environment is present in the UI.
  • Admin user receives 403 when attempting to delete the environment.

File

tests/src/Functional/AcquiaConnectorSearchTest.php, line 164

Class

AcquiaConnectorSearchTest
Tests the functionality of the Acquia Search module.

Namespace

Drupal\Tests\acquia_search\Functional

Code

public function testEnvironmentUi() {
  $this
    ->drupalGet($this->settingsPath);

  // Check the Acquia Search Server is displayed.
  $this
    ->assertLinkByHref('/admin/config/search/search-api/server/' . $this->server, 0, t('The Acquia Search Server is displayed in the UI.'));

  // Check the Acquia Search Index is displayed.
  $this
    ->assertLinkByHref('/admin/config/search/search-api/index/' . $this->index, 0, t('The Acquia Search Index is displayed in the UI.'));

  // Delete the environment.
  $this
    ->drupalGet('/admin/config/search/search-api/server/' . $this->server . '/edit');
  $this
    ->clickLink('Delete', 0);
  $this
    ->assertResponse(403, t('The Acquia Search environment cannot be deleted via the UI.'));
}