You are here

protected function ApigeeEdgeManagementCliServiceTest::setUp in Apigee Edge 8

Same name in this branch
  1. 8 tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php \Drupal\Tests\apigee_edge\Kernel\Util\ApigeeEdgeManagementCliServiceTest::setUp()
  2. 8 tests/src/Unit/Command/Util/ApigeeEdgeManagementCliServiceTest.php \Drupal\Tests\apigee_edge\Unit\Command\Util\ApigeeEdgeManagementCliServiceTest::setUp()

Overrides KernelTestBase::setUp

File

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

Class

ApigeeEdgeManagementCliServiceTest
ApigeeEdgeManagementCliService Edge tests.

Namespace

Drupal\Tests\apigee_edge\Kernel\Util

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $this
    ->installSchema('user', [
    'users_data',
  ]);
  $this
    ->installEntitySchema('user');
  $this
    ->apigeeTestHelperSetup();
  $environment_vars = [
    'APIGEE_EDGE_ENDPOINT',
    'APIGEE_EDGE_ORGANIZATION',
    'APIGEE_EDGE_USERNAME',
    'APIGEE_EDGE_PASSWORD',
  ];
  foreach ($environment_vars as $environment_var) {
    if (!getenv($environment_var)) {
      $this
        ->markTestSkipped('Environment variable ' . $environment_var . ' is not set, cannot run tests. See CONTRIBUTING.md for more information.');
    }
  }

  // Get environment variables for Edge connection.
  $this->endpoint = getenv('APIGEE_EDGE_ENDPOINT');
  $this->organization = getenv('APIGEE_EDGE_ORGANIZATION');
  $this->orgadminEmail = getenv('APIGEE_EDGE_USERNAME');
  $this->orgadminPassword = getenv('APIGEE_EDGE_PASSWORD');

  /** @var \GuzzleHttp\Client $client */
  $this->httpClient = $this->sdkConnector
    ->getClient();
}