You are here

protected function DeveloperAppApiKeyTest::tearDown in Apigee Edge 8

Overrides BrowserTestBase::tearDown

File

tests/src/Functional/DeveloperAppApiKeyTest.php, line 148

Class

DeveloperAppApiKeyTest
Developer app API key test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function tearDown() {
  $this->stack
    ->reset();
  try {
    if ($this->account) {
      $developer = \Drupal::entityTypeManager()
        ->getStorage('developer')
        ->create([
        'email' => $this->account
          ->getEmail(),
      ]);
      $developer
        ->delete();
    }
    if ($this->developerApp) {
      $this->developerApp
        ->delete();
    }
  } catch (\Exception $exception) {
    $this
      ->logException($exception);
  }
  try {
    if ($this->apiProducts !== NULL) {
      foreach ($this->apiProducts as $product) {
        $product
          ->delete();
      }
    }
  } catch (\Exception $exception) {
    $this
      ->logException($exception);
  }
  parent::tearDown();
}