You are here

protected function DeveloperSyncTest::tearDown in Apigee Edge 8

Overrides BrowserTestBase::tearDown

File

tests/src/Functional/DeveloperSyncTest.php, line 442

Class

DeveloperSyncTest
Developer-user synchronization test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function tearDown() {
  $developers_to_delete = array_merge($this->edgeDevelopers, $this->drupalUsers, $this->modifiedEdgeDevelopers, $this->modifiedDrupalUsers);
  foreach ($developers_to_delete as $email => $entity) {
    try {

      /** @var \Drupal\apigee_edge\Entity\DeveloperInterface $developer */
      if (($developer = Developer::load($email)) !== NULL) {
        $developer
          ->delete();
      }
    } catch (\Exception $exception) {
      $this
        ->logException($exception);
    }
  }
  try {

    /** @var \Drupal\apigee_edge\Entity\DeveloperInterface $developer */
    if (($developer = Developer::load("{$this->prefix}.reserved@example.com")) !== NULL) {
      $developer
        ->delete();
    }
  } catch (\Exception $exception) {
    $this
      ->logException($exception);
  }
  try {
    if ($this->inactiveDeveloper !== NULL) {
      $this->inactiveDeveloper
        ->delete();
    }
  } catch (\Exception $exception) {
    $this
      ->logException($exception);
  }
  parent::tearDown();
}