You are here

public function PublishOnlyRenderedTest::register in Acquia Lift Connector 8.4

Registers test-specific services.

Extend this method in your test to register additional services. This method is called whenever the kernel is rebuilt.

Parameters

\Drupal\Core\DependencyInjection\ContainerBuilder $container: The service container to enhance.

Overrides KernelTestBase::register

See also

\Drupal\Tests\KernelTestBase::bootKernel()

File

modules/acquia_lift_publisher/tests/src/Kernel/EventSubscriber/Publish/PublishOnlyRenderedTest.php, line 77

Class

PublishOnlyRenderedTest
Class PublishOnlyRenderedTest.

Namespace

Drupal\Tests\acquia_lift_publisher\Kernel\EventSubscriber\Publish

Code

public function register(ContainerBuilder $container) {
  $client = $this
    ->prophesize(ContentHubClient::class);
  $client
    ->getEntities(Argument::type('array'))
    ->willReturn(new CDFDocument());
  $settings = $this
    ->prophesize(Settings::class);
  $settings
    ->getUuid()
    ->willReturn('93b95dc0-116a-477c-9a76-5944998295c1');
  $client_factory = $this
    ->prophesize(ClientFactory::class);
  $client_factory
    ->getClient()
    ->willReturn($client
    ->reveal());
  $client_factory
    ->getSettings()
    ->willReturn($settings
    ->reveal());
  $container
    ->set('acquia_contenthub.client.factory', $client_factory
    ->reveal());
  parent::register($container);
}