You are here

protected function ApigeeEdgeManagementCliServiceTest::tearDown in Apigee Edge 8

Overrides KernelTestBase::tearDown

File

tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php, line 136

Class

ApigeeEdgeManagementCliServiceTest
ApigeeEdgeManagementCliService Edge tests.

Namespace

Drupal\Tests\apigee_edge\Kernel\Util

Code

protected function tearDown() {
  $url = $this->endpoint . '/o/' . $this->organization . '/userroles/' . self::TEST_ROLE_NAME;
  try {
    $this->stack
      ->queueMockResponse('get_not_found');
    $response = $this->httpClient
      ->get($url);
    if ($response
      ->getStatusCode() == 200) {
      $url = $this->endpoint . '/o/' . $this->organization . '/userroles/' . self::TEST_ROLE_NAME;
      $this->httpClient
        ->delete($url);
    }
  } catch (\Exception $exception) {
    watchdog_exception('apigee_edge', $exception);
  }
  parent::tearDown();
}