LingotekTestServiceProvider.php in Lingotek Translation 3.3.x
Same filename and directory in other branches
- 8 tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 8.2 tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 4.0.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.0.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.1.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.2.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.4.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.5.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.6.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.7.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
- 3.8.x tests/modules/lingotek_test/src/LingotekTestServiceProvider.php
Namespace
Drupal\lingotek_testFile
tests/modules/lingotek_test/src/LingotekTestServiceProvider.phpView source
<?php
namespace Drupal\lingotek_test;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Symfony\Component\DependencyInjection\Reference;
/**
* 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')
->setArguments([
new Reference('lingotek.api'),
new Reference('lingotek.language_locale_mapper'),
new Reference('config.factory'),
]);
$definition = $container
->getDefinition('config.factory');
$definition
->setClass('Drupal\\lingotek_test\\LingotekFakeConfigFactory');
}
}
Classes
Name | Description |
---|---|
LingotekTestServiceProvider | Modifies the lingotek service. |