You are here

LingotekTestServiceProvider.php in Lingotek Translation 8

Contains Drupal\lingotek_test\LingotekServiceProvider

File

tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
View source
<?php

/**
 * @file
 * Contains Drupal\lingotek_test\LingotekServiceProvider
 */
namespace Drupal\lingotek_test;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

/**
 * Modifies the lingotek service.
 */
class LingotekTestServiceProvider extends ServiceProviderBase {

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

    // Overrides lingotek class to mock communication with the server.
    $definition = $container
      ->getDefinition('lingotek');
    $definition
      ->setClass('Drupal\\lingotek_test\\LingotekFake');
  }

}

Classes

Namesort descending Description
LingotekTestServiceProvider Modifies the lingotek service.