You are here

protected function AppListBuilderTest::tearDown in Apigee Edge 8

Overrides KernelTestBase::tearDown

File

tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php, line 219

Class

AppListBuilderTest
Tests the AppListBuilder.

Namespace

Drupal\Tests\apigee_edge\Kernel\Entity\ListBuilder

Code

protected function tearDown() {
  $this->stack
    ->reset();
  try {
    if ($this->account) {
      $this
        ->queueDeveloperResponse($this->account);
      $developer = \Drupal::entityTypeManager()
        ->getStorage('developer')
        ->create([
        'email' => $this->account
          ->getEmail(),
      ]);
      $developer
        ->delete();
    }
    if ($this->approvedAppWithApprovedCredential) {
      $this->approvedAppWithApprovedCredential
        ->delete();
    }
    if ($this->approvedAppWithOneRevokedCredential) {
      $this->approvedAppWithOneRevokedCredential
        ->delete();
    }
    if ($this->approvedAppWithAllRevokedCredential) {
      $this->approvedAppWithAllRevokedCredential
        ->delete();
    }
    if ($this->revokedAppWithRevokedCredential) {
      $this->revokedAppWithRevokedCredential
        ->delete();
    }
    if ($this->approvedAppWithExpiredCredential) {
      $this->approvedAppWithExpiredCredential
        ->delete();
    }
    if ($this->revokedAppWithExpiredCredential) {
      $this->revokedAppWithExpiredCredential
        ->delete();
    }
  } catch (\Exception $exception) {
    $this
      ->logException($exception);
  }
  parent::tearDown();
}