You are here

public function AcquiaSearchWebTestCase::testEnvironmentUi in Acquia Connector 7.3

Same name and namespace in other branches
  1. 7.2 acquia_search/tests/acquia_search.test \AcquiaSearchWebTestCase::testEnvironmentUI()

Test 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.
  • Acquia Search is reflected as the default environment in the UI.
  • Admin user receives 403 when attempting to delete the environment.

File

acquia_search/tests/acquia_search.test, line 578
Tests for the Acquia Search module.

Class

AcquiaSearchWebTestCase
Tests the functionality of the Acquia Search module.

Code

public function testEnvironmentUi() {
  $this
    ->enableAcquiaSearchEnvironment();
  $admin_user = $this
    ->createAdminUser();
  $this
    ->drupalLogin($admin_user);
  $settings_path = 'admin/config/search/apachesolr/settings';
  $this
    ->drupalGet($settings_path);
  $this
    ->assertText('Acquia Search', t('The Acquia Search environment is displayed in the UI.'), 'Acquia Search');
  $path = 'admin/config/search/apachesolr/settings/' . ACQUIA_SEARCH_ENVIRONMENT_ID . '/edit';
  $options = array(
    'query' => array(
      'destination' => $settings_path,
    ),
  );
  $link = l(t('Acquia Search'), $path, $options);
  $raw = t('!environment <em>(Default)</em>', array(
    '!environment' => $link,
  ));
  $this
    ->assertRaw($raw, t('The Acquia Search environment is reflected as the default in the UI.'), 'Acquia Search');
  $this
    ->drupalGet('admin/config/search/apachesolr/settings/' . ACQUIA_SEARCH_ENVIRONMENT_ID . '/delete');
  $this
    ->assertResponse(403, t('The Acquia Search environment cannot be deleted via the UI.'));
}