Commit b1c684b8 authored by alexpott's avatar alexpott

Issue #1988508 by katbailey: Stop pretending we support Symfony bundles when...

Issue #1988508 by katbailey: Stop pretending we support Symfony bundles when we really just have service providers.
parent 77947830
...@@ -1889,8 +1889,7 @@ function drupal_handle_request($test_only = FALSE) { ...@@ -1889,8 +1889,7 @@ function drupal_handle_request($test_only = FALSE) {
exit; exit;
} }
// @todo Figure out how best to handle the Kernel constructor parameters. $kernel = new DrupalKernel('prod', drupal_classloader(), !$test_only);
$kernel = new DrupalKernel('prod', FALSE, drupal_classloader(), !$test_only);
// @todo Remove this once everything in the bootstrap has been // @todo Remove this once everything in the bootstrap has been
// converted to services in the DIC. // converted to services in the DIC.
...@@ -2026,7 +2025,7 @@ function _drupal_bootstrap_kernel() { ...@@ -2026,7 +2025,7 @@ function _drupal_bootstrap_kernel() {
// Normally, index.php puts a container in drupal_container() by creating a // Normally, index.php puts a container in drupal_container() by creating a
// kernel. If there is no container yet, create one. // kernel. If there is no container yet, create one.
if (!drupal_container()) { if (!drupal_container()) {
$kernel = new DrupalKernel('prod', FALSE, drupal_classloader()); $kernel = new DrupalKernel('prod', drupal_classloader());
$kernel->boot(); $kernel->boot();
} }
} }
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\FileStorage;
use Drupal\Core\DrupalKernel; use Drupal\Core\DrupalKernel;
use Drupal\Core\CoreBundle; use Drupal\Core\CoreServiceProvider;
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use Drupal\Core\Database\Install\TaskException; use Drupal\Core\Database\Install\TaskException;
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageManager; use Drupal\Core\Language\LanguageManager;
use Drupal\Core\StringTranslation\Translator\FileTranslation; use Drupal\Core\StringTranslation\Translator\FileTranslation;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -354,7 +354,7 @@ function install_begin_request(&$install_state) { ...@@ -354,7 +354,7 @@ function install_begin_request(&$install_state) {
// @see drupal_install_config_directories() // @see drupal_install_config_directories()
// @see install_settings_form_submit() // @see install_settings_form_submit()
if ($install_state['settings_verified']) { if ($install_state['settings_verified']) {
$kernel = new DrupalKernel('install', FALSE, drupal_classloader(), FALSE); $kernel = new DrupalKernel('install', drupal_classloader(), FALSE);
$kernel->boot(); $kernel->boot();
$container = $kernel->getContainer(); $container = $kernel->getContainer();
// Add the file translation service to the container. // Add the file translation service to the container.
...@@ -426,7 +426,7 @@ function install_begin_request(&$install_state) { ...@@ -426,7 +426,7 @@ function install_begin_request(&$install_state) {
$conf['keyvalue_expirable_default'] = 'keyvalue.expirable.null'; $conf['keyvalue_expirable_default'] = 'keyvalue.expirable.null';
// Register Twig template engine for use during install. // Register Twig template engine for use during install.
CoreBundle::registerTwig($container); CoreServiceProvider::registerTwig($container);
$container->register('url_generator', 'Drupal\Core\Routing\NullGenerator'); $container->register('url_generator', 'Drupal\Core\Routing\NullGenerator');
......
...@@ -619,7 +619,7 @@ function drupal_install_system() { ...@@ -619,7 +619,7 @@ function drupal_install_system() {
if (!drupal_container()->has('kernel')) { if (!drupal_container()->has('kernel')) {
// Immediately boot a kernel to have real services ready. // Immediately boot a kernel to have real services ready.
$kernel = new DrupalKernel('install', FALSE, drupal_classloader(), FALSE); $kernel = new DrupalKernel('install', drupal_classloader(), FALSE);
$kernel->boot(); $kernel->boot();
} }
......
...@@ -103,10 +103,9 @@ function update_prepare_d8_bootstrap() { ...@@ -103,10 +103,9 @@ function update_prepare_d8_bootstrap() {
$settings['cache']['default'] = 'cache.backend.memory'; $settings['cache']['default'] = 'cache.backend.memory';
new Settings($settings); new Settings($settings);
// Enable UpdateBundle service overrides. While the container_bundles array // Enable UpdateServiceProvider service overrides.
// does not need a key, let's use so it can be removed once the upgrade are // @see update_flush_all_caches()
// finished. @see update_flush_all_caches() $GLOBALS['conf']['container_service_providers']['UpdateServiceProvider'] = 'Drupal\Core\DependencyInjection\UpdateServiceProvider';
$GLOBALS['conf']['container_bundles']['UpdateBundle'] = 'Drupal\Core\DependencyInjection\UpdateBundle';
// Check whether settings.php needs to be rewritten. // Check whether settings.php needs to be rewritten.
$settings_exist = !empty($GLOBALS['config_directories']); $settings_exist = !empty($GLOBALS['config_directories']);
...@@ -117,7 +116,7 @@ function update_prepare_d8_bootstrap() { ...@@ -117,7 +116,7 @@ function update_prepare_d8_bootstrap() {
// Bootstrap the kernel. // Bootstrap the kernel.
// Do not attempt to dump and write it. // Do not attempt to dump and write it.
$kernel = new DrupalKernel('update', FALSE, drupal_classloader(), FALSE); $kernel = new DrupalKernel('update', drupal_classloader(), FALSE);
$kernel->boot(); $kernel->boot();
// If any of the required settings needs to be written, then settings.php // If any of the required settings needs to be written, then settings.php
...@@ -440,7 +439,7 @@ function update_prepare_d8_bootstrap() { ...@@ -440,7 +439,7 @@ function update_prepare_d8_bootstrap() {
$settings = settings()->getAll(); $settings = settings()->getAll();
unset($settings['cache']['default']); unset($settings['cache']['default']);
new Settings($settings); new Settings($settings);
$kernel = new DrupalKernel('update', FALSE, drupal_classloader(), FALSE); $kernel = new DrupalKernel('update', drupal_classloader(), FALSE);
$kernel->boot(); $kernel->boot();
} }
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* *
* The container is built by the kernel and passed in to this class which stores * The container is built by the kernel and passed in to this class which stores
* it statically. The container always contains the services from * it statically. The container always contains the services from
* \Drupal\Core\CoreBundle, the bundles of enabled modules and any other bundles * \Drupal\Core\CoreServiceProvider, the service providers of enabled modules and any other
* defined in $GLOBALS['conf']['container_bundles']. * service providers defined in $GLOBALS['conf']['container_service_providers'].
* *
* This class exists only to support legacy code that cannot be dependency * This class exists only to support legacy code that cannot be dependency
* injected. If your code needs it, consider refactoring it to be object * injected. If your code needs it, consider refactoring it to be object
......
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
/** /**
* @file * @file
* Definition of Drupal\Core\CoreBundle. * Definition of Drupal\Core\CoreServiceProvider.
*/ */
namespace Drupal\Core; namespace Drupal\Core;
use Drupal\Core\Cache\ListCacheBinsPass; use Drupal\Core\Cache\ListCacheBinsPass;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterKernelListenersPass; use Drupal\Core\DependencyInjection\Compiler\RegisterKernelListenersPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass; use Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterMatchersPass; use Drupal\Core\DependencyInjection\Compiler\RegisterMatchersPass;
...@@ -18,16 +21,14 @@ ...@@ -18,16 +21,14 @@
use Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass; use Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterStringTranslatorsPass; use Drupal\Core\DependencyInjection\Compiler\RegisterStringTranslatorsPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterBreadcrumbBuilderPass; use Drupal\Core\DependencyInjection\Compiler\RegisterBreadcrumbBuilderPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Scope; use Symfony\Component\DependencyInjection\Scope;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\Compiler\PassConfig;
/** /**
* Bundle class for mandatory core services. * ServiceProvider class for mandatory core services.
* *
* This is where Drupal core registers all of its compiler passes. * This is where Drupal core registers all of its compiler passes.
* The service definitions themselves are in core/core.services.yml with a * The service definitions themselves are in core/core.services.yml with a
...@@ -36,12 +37,12 @@ ...@@ -36,12 +37,12 @@
* Modules wishing to register services to the container should use * Modules wishing to register services to the container should use
* modulename.services.yml in their respective directories. * modulename.services.yml in their respective directories.
*/ */
class CoreBundle extends Bundle { class CoreServiceProvider implements ServiceProviderInterface {
/** /**
* Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build(). * {@inheritdoc}
*/ */
public function build(ContainerBuilder $container) { public function register(ContainerBuilder $container) {
// The 'request' scope and service enable services to depend on the Request // The 'request' scope and service enable services to depend on the Request
// object and get reconstructed when the request object changes (e.g., // object and get reconstructed when the request object changes (e.g.,
// during a subrequest). // during a subrequest).
...@@ -67,6 +68,9 @@ public function build(ContainerBuilder $container) { ...@@ -67,6 +68,9 @@ public function build(ContainerBuilder $container) {
// Add the compiler pass that will process the tagged breadcrumb builder // Add the compiler pass that will process the tagged breadcrumb builder
// services. // services.
$container->addCompilerPass(new RegisterBreadcrumbBuilderPass()); $container->addCompilerPass(new RegisterBreadcrumbBuilderPass());
// Add the compiler pass that lets service providers modify existing
// service definitions.
$container->addCompilerPass(new ModifyServiceDefinitionsPass());
} }
/** /**
......
<?php
/**
* @file
* Contains Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass.
*/
namespace Drupal\Core\DependencyInjection\Compiler;
use Drupal\Core\DrupalKernelInterface;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* Passes the container to the alter() method of all service providers.
*/
class ModifyServiceDefinitionsPass implements CompilerPassInterface {
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container) {
if (!$container->has('kernel')) {
return;
}
$kernel = $container->get('kernel');
if (!($kernel instanceof DrupalKernelInterface)) {
return;
}
$providers = $kernel->getServiceProviders();
foreach ($providers as $provider) {
if ($provider instanceof ServiceModifierInterface) {
$provider->alter($container);
}
}
}
}
<?php
namespace Drupal\Core\DependencyInjection;
/**
* Interface that service providers can implement to modify services.
*/
interface ServiceModifierInterface {
/**
* Modifies existing service definitions.
*
* @param ContainerBuilder $container
* The ContainerBuilder whose service definitions can be altered.
*/
public function alter(ContainerBuilder $container);
}
<?php
namespace Drupal\Core\DependencyInjection;
/**
* Interface that all service providers must implement.
*/
interface ServiceProviderInterface {
/**
* Registers services to the container.
*
* @param ContainerBuilder $container
* The ContainerBuilder to register services to.
*/
public function register(ContainerBuilder $container);
}
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
/** /**
* @file * @file
* Contains \Drupal\Core\DependencyInjection\UpdateBundle. * Contains \Drupal\Core\DependencyInjection\UpdateServiceProvider.
*/ */
namespace Drupal\Core\DependencyInjection; namespace Drupal\Core\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Drupal\Core\DependencyInjection\ServiceProviderInterface;
/** /**
* Bundle class for update.php service overrides. * ServiceProvider class for update.php service overrides.
* *
* This bundle is manually added by update.php via $conf['container_bundles'] * This class is manually added by update.php via $conf['container_service_providers']
* and required to prevent various services from trying to retrieve data from * and required to prevent various services from trying to retrieve data from
* storages that do not exist yet. * storages that do not exist yet.
*/ */
class UpdateBundle extends Bundle { class UpdateServiceProvider implements ServiceProviderInterface {
/** /**
* Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build(). * {@inheritdoc}
*/ */
public function build(SymfonyContainerBuilder $container) { public function register(ContainerBuilder $container) {
// Disable the Lock service. // Disable the Lock service.
$container $container
->register('lock', 'Drupal\Core\Lock\NullLockBackend'); ->register('lock', 'Drupal\Core\Lock\NullLockBackend');
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\Core; namespace Drupal\Core;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
/** /**
* The interface for DrupalKernel, the core of Drupal. * The interface for DrupalKernel, the core of Drupal.
...@@ -15,7 +15,40 @@ ...@@ -15,7 +15,40 @@
* This interface extends Symfony's KernelInterface and adds methods for * This interface extends Symfony's KernelInterface and adds methods for
* responding to modules being enabled or disabled during its lifetime. * responding to modules being enabled or disabled during its lifetime.
*/ */
interface DrupalKernelInterface extends KernelInterface { interface DrupalKernelInterface extends HttpKernelInterface, \Serializable {
/**
* Boots the current kernel.
*/
public function boot();
/**
* Shuts down the kernel.
*/
public function shutdown();
/**
* Discovers available serviceProviders.
*
* @return array
* The available serviceProviders.
*/
public function discoverServiceProviders();
/**
* Returns all registered service providers.
*
* @return array
* An associative array of ServiceProvider objects, keyed by name.
*/
public function getServiceProviders();
/**
* Gets the current container.
*
* @return ContainerInterface A ContainerInterface instance
*/
public function getContainer();
/** /**
* Updates the kernel's list of modules to the new list. * Updates the kernel's list of modules to the new list.
......
...@@ -81,7 +81,7 @@ class ModuleHandler implements ModuleHandlerInterface { ...@@ -81,7 +81,7 @@ class ModuleHandler implements ModuleHandlerInterface {
* %container.modules% parameter being set up by DrupalKernel. * %container.modules% parameter being set up by DrupalKernel.
* *
* @see \Drupal\Core\DrupalKernel * @see \Drupal\Core\DrupalKernel
* @see \Drupal\Core\CoreBundle * @see \Drupal\Core\CoreServiceProvider
*/ */
public function __construct(array $module_list = array()) { public function __construct(array $module_list = array()) {
$this->moduleList = $module_list; $this->moduleList = $module_list;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* This provides a Twig extension that registers various Drupal specific extensions to Twig. * This provides a Twig extension that registers various Drupal specific extensions to Twig.
* *
* @see \Drupal\Core\CoreBundle * @see \Drupal\Core\CoreServiceProvider
*/ */
namespace Drupal\Core\Template; namespace Drupal\Core\Template;
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* A class for providing Twig extensions (specific Twig_NodeVisitors, filters and functions). * A class for providing Twig extensions (specific Twig_NodeVisitors, filters and functions).
* *
* @see \Drupal\Core\CoreBundle * @see \Drupal\Core\CoreServiceProvider
*/ */
class TwigExtension extends \Twig_Extension { class TwigExtension extends \Twig_Extension {
public function getFunctions() { public function getFunctions() {
......
...@@ -2,23 +2,31 @@ ...@@ -2,23 +2,31 @@
/** /**
* @file * @file
* Contains \Drupal\language_test\LanguageTestBundle. * Contains \Drupal\language_test\LanguageTestServiceProvider.
*/ */
namespace Drupal\language_test; namespace Drupal\language_test;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
/** /**
* Defines the LanguageTest bundle. * Defines the LanguageTest service provider.
*/ */
class LanguageTestBundle extends Bundle { class LanguageTestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface {
/** /**
* Overrides \Symfony\Component\HttpKernel\Bundle\Bundle::build(). * {@inheritdoc}
*/ */
public function build(ContainerBuilder $container) { public function register(ContainerBuilder $container) {
}
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
// Overrides language_manager class to test domain language negotiation. // Overrides language_manager class to test domain language negotiation.
$definition = $container->getDefinition('language_manager'); $definition = $container->getDefinition('language_manager');
$definition->setClass('Drupal\language_test\LanguageTestManager'); $definition->setClass('Drupal\language_test\LanguageTestManager');
......
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
/** /**
* @file * @file
* Contains \Drupal\serialization\SerializationBundle. * Contains \Drupal\serialization\SerializationServiceProvider.
*/ */
namespace Drupal\serialization; namespace Drupal\serialization;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Drupal\Core\DependencyInjection\ServiceProviderInterface;
/** /**
* Serialization dependency injection container. * Serialization dependency injection container.
*/ */
class SerializationBundle extends Bundle { class SerializationServiceProvider implements ServiceProviderInterface {
/** /**
* Overrides \Symfony\Component\HttpKernel\Bundle\Bundle::build(). * {@inheritdoc}
*/ */
public function build(ContainerBuilder $container) { public function register(ContainerBuilder $container) {
// Add a compiler pass for adding Normalizers and Encoders to Serializer. // Add a compiler pass for adding Normalizers and Encoders to Serializer.
$container->addCompilerPass(new RegisterSerializationClassesCompilerPass()); $container->addCompilerPass(new RegisterSerializationClassesCompilerPass());
// Add a compiler pass for adding concrete Resolvers to chain Resolver. // Add a compiler pass for adding concrete Resolvers to chain Resolver.
......
...@@ -90,7 +90,7 @@ protected function setUp() { ...@@ -90,7 +90,7 @@ protected function setUp() {
// Build a minimal, partially mocked environment for unit tests. // Build a minimal, partially mocked environment for unit tests.
$this->containerBuild(drupal_container()); $this->containerBuild(drupal_container());
// Make sure it survives kernel rebuilds. // Make sure it survives kernel rebuilds.
$GLOBALS['conf']['container_bundles'][] = 'Drupal\simpletest\TestBundle'; $GLOBALS['conf']['container_service_providers']['TestServiceProvider'] = 'Drupal\simpletest\TestServiceProvider';
\Drupal::state()->set('system.module.files', $this->moduleFiles); \Drupal::state()->set('system.module.files', $this->moduleFiles);
\Drupal::state()->set('system.theme.files', $this->themeFiles); \Drupal::state()->set('system.theme.files', $this->themeFiles);
...@@ -98,7 +98,7 @@ protected function setUp() { ...@@ -98,7 +98,7 @@ protected function setUp() {
// Bootstrap the kernel. // Bootstrap the kernel.
// No need to dump it; this test runs in-memory. // No need to dump it; this test runs in-memory.
$this->kernel = new DrupalKernel('unit_testing', TRUE, drupal_classloader(), FALSE); $this->kernel = new DrupalKernel('unit_testing', drupal_classloader(), FALSE);
$this->kernel->boot(); $this->kernel->boot();
// Collect and set a fixed module list. // Collect and set a fixed module list.
......
...@@ -698,7 +698,7 @@ protected function verbose($message) { ...@@ -698,7 +698,7 @@ protected function verbose($message) {
* methods during debugging. * methods during debugging.
*/ */
public function run(array $methods = array()) { public function run(array $methods = array()) {
TestBundle::$currentTest = $this; TestServiceProvider::$currentTest = $this;
$simpletest_config = config('simpletest.settings'); $simpletest_config = config('simpletest.settings');
$class = get_class($this); $class = get_class($this);
...@@ -770,7 +770,7 @@ public function run(array $methods = array()) { ...@@ -770,7 +770,7 @@ public function run(array $methods = array()) {
} }
} }
} }
TestBundle::$currentTest = NULL; TestServiceProvider::$currentTest = NULL;
// Clear out the error messages and restore error handler. // Clear out the error messages and restore error handler.
drupal_get_messages(); drupal_get_messages();
restore_error_handler(); restore_error_handler();
...@@ -993,7 +993,7 @@ protected function prepareConfigDirectories() { ...@@ -993,7 +993,7 @@ protected function prepareConfigDirectories() {
* @see TestBase::tearDown() * @see TestBase::tearDown()
*/ */
protected function rebuildContainer() { protected function rebuildContainer() {
$this->kernel = new DrupalKernel('testing', FALSE, drupal_classloader(), FALSE); $this->kernel = new DrupalKernel('testing', drupal_classloader(), FALSE);
$this->kernel->boot(); $this->kernel->boot();
// DrupalKernel replaces the container in drupal_container() with a // DrupalKernel replaces the container in drupal_container() with a
// different object, so we need to replace the instance on this test class. // different object, so we need to replace the instance on this test class.
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
namespace Drupal\simpletest; namespace Drupal\simpletest;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderInterface;
class TestBundle extends Bundle { class TestServiceProvider implements ServiceProviderInterface {
/** /**
* @var \Drupal\simpletest\TestBase; * @var \Drupal\simpletest\TestBase;
...@@ -13,12 +13,11 @@ class TestBundle extends Bundle { ...@@ -13,12 +13,11 @@ class TestBundle extends Bundle {
public static $currentTest; public static $currentTest;
/** /**
* Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build(). * {@inheritdoc}
*/ */
function build(ContainerBuilder $container) { function register(ContainerBuilder $container) {
if (static::$currentTest && method_exists(static::$currentTest, 'containerBuild')) { if (static::$currentTest && method_exists(static::$currentTest, 'containerBuild')) {
static::$currentTest->containerBuild($container); static::$currentTest->containerBuild($container);
} }
} }
} }
...@@ -201,7 +201,7 @@ function hook_language_fallback_candidates_alter(array &$fallback_candidates) { ...@@ -201,7 +201,7 @@ function hook_language_fallback_candidates_alter(array &$fallback_candidates) {
* hook_transliteration_overrides_alter() to provide further language-specific * hook_transliteration_overrides_alter() to provide further language-specific
* overrides (including providing transliteration for Unicode characters that * overrides (including providing transliteration for Unicode characters that
* are longer than 4 bytes). Modules can also completely override the * are longer than 4 bytes). Modules can also completely override the
* transliteration classes in \Drupal\Core\CoreBundle. * transliteration classes in \Drupal\Core\CoreServiceProvider.
*/ */
/** /**
......
<?php
/**
* @file
* Definition of Drupal\system\Tests\Bundle\BundleTest.
*/
namespace Drupal\system\Tests\Bundle;
use Drupal\simpletest\WebTestBase;
/**
* Tests bundle registration to the DIC.
*/
class BundleTest extends WebTestBase {