public function MockIntegrationToggleKernelTest::testIntegrationToggleOn in Apigee Edge 8
Tests that the sdk client will be unaffected while integration is enabled.
File
- tests/
src/ Kernel/ MockIntegrationToggleKernelTest.php, line 92
Class
- MockIntegrationToggleKernelTest
- Tests the testing framework for testing offline.
Namespace
Drupal\Tests\apigee_edge\KernelCode
public function testIntegrationToggleOn() {
$integration_enabled = getenv('APIGEE_INTEGRATION_ENABLE');
putenv('APIGEE_INTEGRATION_ENABLE=1');
$this
->enableModules([
'apigee_mock_api_client',
]);
$handler = $this->container
->get('apigee_mock_api_client.mock_http_client_factory')
->fromOptions([])
->getConfig('handler');
self::assertInstanceOf(HandlerStack::class, $handler);
putenv('APIGEE_INTEGRATION_ENABLE=' . $integration_enabled ? 1 : 0);
}