You are here

public function AcquiaSPITestCase::testAcquiaSpiRevokedInstall in Acquia Connector 7.3

Needs comment.

File

acquia_spi/tests/acquia_spi.test, line 356

Class

AcquiaSPITestCase
Tests the functionality of the Acquia SPI module.

Code

public function testAcquiaSpiRevokedInstall() {
  $server = array(
    'AH_SITE_NAME' => 'site_name',
    'AH_SITE_ENVIRONMENT' => 'dev',
  );
  variable_set('acquia_agent_server_superglobal', $server);

  // Confirm the site is not blocked yet.
  $this
    ->assertFalse(variable_get('acquia_spi_blocked', FALSE));

  // Connect using credentials for a revoked site.
  $edit_fields = array(
    'acquia_identifier' => ACQUIA_CONNECTOR_TEST_REVOKED_ID,
    'acquia_key' => ACQUIA_CONNECTOR_TEST_REVOKED_KEY,
  );
  $submit_button = 'Connect';
  $this
    ->drupalPost($this->credentialsPath, $edit_fields, $submit_button);

  // Try to send SPI data.
  $spi_data = acquia_spi_get();
  $response = acquia_spi_send_data($spi_data);
  acquia_spi_handle_server_response($response);

  // Confirm the site has been blocked.
  $this
    ->assertTrue(variable_get('acquia_spi_blocked', FALSE));
  variable_del('acquia_agent_server_superglobal');
}