You are here

public function TestFrameworkKernelTest::testMatchedResponse in Apigee Edge 8

Tests that a response is fetched from the mocks using response matcher.

File

tests/src/Kernel/TestFrameworkKernelTest.php, line 119

Class

TestFrameworkKernelTest
Tests the testing framework for testing offline.

Namespace

Drupal\Tests\apigee_edge\Kernel

Code

public function testMatchedResponse() {
  if ($this->integration_enabled) {
    $this
      ->markTestSkipped('Integration enabled, skipping test.');
  }
  $org_name = $this
    ->randomMachineName();

  // Stack up org response.
  $this
    ->addOrganizationMatchedResponse($org_name);
  $org_controller = $this->container
    ->get('apigee_edge.controller.organization');
  $org = $org_controller
    ->load($org_name);
  $this
    ->assertEqual($org
    ->getName(), $org_name);
}