You are here

protected function TeamApiProductAccessTest::tearDown in Apigee Edge 8

Overrides BrowserTestBase::tearDown

File

modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php, line 168

Class

TeamApiProductAccessTest
Team-level API product access test.

Namespace

Drupal\Tests\apigee_edge_teams\Functional

Code

protected function tearDown() {
  try {
    if ($this->team !== NULL) {
      $this->teamStorage
        ->delete([
        $this->team,
      ]);
    }
  } catch (\Exception $exception) {
    $this
      ->logException($exception);
  }
  foreach ([
    'developer',
    'team_member',
  ] as $developer_property) {
    if ($this->{$developer_property}) {
      try {
        $this->{$developer_property}
          ->delete();
      } catch (\Exception $exception) {
        $this
          ->logException($exception);
      }
    }
  }
  foreach ($this->apiProducts as $product) {
    try {
      $this->apiProductStorage
        ->delete([
        $product,
      ]);
    } catch (\Exception $exception) {
      $this
        ->logException($exception);
    }
  }
  parent::tearDown();
}