You are here

public function AcquiaContenthubServerTestServiceProvider::alter in Acquia Content Hub 8.2

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

tests/modules/acquia_contenthub_server_test/src/AcquiaContenthubServerTestServiceProvider.php, line 17

Class

AcquiaContenthubServerTestServiceProvider
Replace Content Hub Client Factory service for testing purposes.

Namespace

Drupal\acquia_contenthub_server_test

Code

public function alter(ContainerBuilder $container) {
  $client_factory_def = $container
    ->getDefinition('acquia_contenthub.client.factory');
  $client_factory_def
    ->setClass('Drupal\\acquia_contenthub_server_test\\Client\\ClientFactoryMock');
  $pv_client_def = $container
    ->getDefinition('acquia_contenthub.project_version_client');
  $pv_client_def
    ->setClass(ProjectVersionClientMock::class);
}