You are here

public function UninstallTest::testUninstallRemoveAuthData in Commerce Square Connect 8

Tests OAuth data is removed from the state key value store.

File

tests/src/Kernel/UninstallTest.php, line 23

Class

UninstallTest
Tests the uninstall of the module.

Namespace

Drupal\Tests\commerce_square\Kernel

Code

public function testUninstallRemoveAuthData() {
  $this->container
    ->get('state')
    ->set('commerce_square.production_access_token', 'TESTTOKEN');
  $this->container
    ->get('state')
    ->set('commerce_square.production_access_token_expiry', $this->container
    ->get('datetime.time')
    ->getRequestTime());
  $this->container
    ->get('module_installer')
    ->uninstall([
    'commerce_square',
  ]);
  $this
    ->assertNull($this->container
    ->get('state')
    ->get('commerce_square.production_access_token'));
  $this
    ->assertNull($this->container
    ->get('state')
    ->get('commerce_square.production_access_token_expiry'));
}