You are here

class SalesforceTestRestClientServiceProvider in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 tests/modules/salesforce_test_rest_client/src/SalesforceTestRestClientServiceProvider.php \Drupal\salesforce_test_rest_client\SalesforceTestRestClientServiceProvider
  2. 5.0.x tests/modules/salesforce_test_rest_client/src/SalesforceTestRestClientServiceProvider.php \Drupal\salesforce_test_rest_client\SalesforceTestRestClientServiceProvider

Modifies the salesforce client service.

Hierarchy

Expanded class hierarchy of SalesforceTestRestClientServiceProvider

File

tests/modules/salesforce_test_rest_client/src/SalesforceTestRestClientServiceProvider.php, line 15

Namespace

Drupal\salesforce_test_rest_client
View source
class SalesforceTestRestClientServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {

    // Overrides salesforce.client class to stub in our own fake methods.
    $container
      ->getDefinition('http_client_factory')
      ->setClass(TestHttpClientFactory::class);
    $container
      ->getDefinition('salesforce.client')
      ->setClass(TestRestClient::class);
    $container
      ->getDefinition('salesforce.client')
      ->setClass(TestRestClient::class);
    $container
      ->getDefinition('plugin.manager.salesforce.auth_providers')
      ->setClass(TestSalesforceAuthProviderPluginManager::class);
    $container
      ->getDefinition('salesforce.http_client_wrapper')
      ->setClass(TestHttpClientWrapper::class);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SalesforceTestRestClientServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1