You are here

public function OauthTokenFileStorageTest::testTokenFileRemovalOnUninstall in Apigee Edge 8

Tests OAuth token data file removal on module uninstall.

File

tests/src/Kernel/OauthTokenFileStorageTest.php, line 233

Class

OauthTokenFileStorageTest
OAuth cache storage tests.

Namespace

Drupal\Tests\apigee_edge\Kernel

Code

public function testTokenFileRemovalOnUninstall() {
  $storage = $this
    ->tokenStorage();

  // Save the token.
  $storage
    ->saveToken($this->testTokenData);
  $this
    ->assertTrue(file_exists($this
    ->tokenFileUri()), 'Oauth token data file should not exist after the module got uninstalled.');

  /** @var \Drupal\Core\Extension\ModuleInstallerInterface $installer */
  $installer = $this->container
    ->get('module_installer');
  $installer
    ->uninstall([
    'apigee_edge',
  ]);
  $this
    ->assertFalse(file_exists($this
    ->tokenFileUri()), 'Oauth token data file should not exist after the module got uninstalled.');
}