function BackendCompilerPassTest::getSqliteContainer
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\BackendCompilerPassTest::getSqliteContainer()
- 10 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\BackendCompilerPassTest::getSqliteContainer()
- 9 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\BackendCompilerPassTest::getSqliteContainer()
- 8.9.x core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\BackendCompilerPassTest::getSqliteContainer()
Creates a container with a sqlite database service in it.
This is necessary because the container clone does not clone the parameter bag so the setParameter() call effects the parent container as well.
Parameters
\Symfony\Component\DependencyInjection\Definition $service: The service definition.
Return value
\Symfony\Component\DependencyInjection\ContainerBuilder The container with a sqlite database service in it.
1 call to BackendCompilerPassTest::getSqliteContainer()
- BackendCompilerPassTest::testProcess in core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ Compiler/ BackendCompilerPassTest.php - Tests the process method.
File
-
core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ Compiler/ BackendCompilerPassTest.php, line 126
Class
Namespace
Drupal\Tests\Core\DependencyInjection\CompilerCode
protected function getSqliteContainer(Definition $service) : ContainerBuilder {
$container = new ContainerBuilder();
$container->setDefinition('service', $service);
$container->setDefinition('sqlite.service', new Definition(__NAMESPACE__ . '\\ServiceClassSqlite'));
$database = new SqliteDatabase($this->createStub(SqliteConnection::class), []);
$container->set('database', $database);
return $container;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.