You are here

protected function AcquiaConnectorModuleTest::disconnectSite in Acquia Connector 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/AcquiaConnectorModuleTest.php \Drupal\Tests\acquia_connector\Functional\AcquiaConnectorModuleTest::disconnectSite()
  2. 3.x tests/src/Functional/AcquiaConnectorModuleTest.php \Drupal\Tests\acquia_connector\Functional\AcquiaConnectorModuleTest::disconnectSite()

Clear the connection data thus simulating a disconnected site.

1 call to AcquiaConnectorModuleTest::disconnectSite()
AcquiaConnectorModuleTest::testAcquiaConnectorGetConnectedTests in tests/src/Functional/AcquiaConnectorModuleTest.php
Test get connected.

File

tests/src/Functional/AcquiaConnectorModuleTest.php, line 625

Class

AcquiaConnectorModuleTest
Tests the functionality of the Acquia Connector module.

Namespace

Drupal\Tests\acquia_connector\Functional

Code

protected function disconnectSite() {
  $config = \Drupal::configFactory()
    ->getEditable('acquia_connector.settings');
  \Drupal::state()
    ->delete('acquia_subscription_data');
  \Drupal::state()
    ->set('acquia_subscription_data', [
    'active' => FALSE,
  ]);
  $config
    ->save();
  $storage = new Storage();
  $storage
    ->setKey('');
  $storage
    ->setIdentifier('');
  \Drupal::state()
    ->set('acquia_connector_test_request_count', 0);
  \Drupal::state()
    ->delete('spi.site_name');
  \Drupal::state()
    ->delete('spi.site_machine_name');
  \Drupal::state()
    ->resetCache();
}