本文整理汇总了PHP中Drupal\KernelTests\KernelTestBase::register方法的典型用法代码示例。如果您正苦于以下问题:PHP KernelTestBase::register方法的具体用法?PHP KernelTestBase::register怎么用?PHP KernelTestBase::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\KernelTests\KernelTestBase
的用法示例。
在下文中一共展示了KernelTestBase::register方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
$parameters = $container->getParameter('twig.config');
$parameters['debug'] = TRUE;
$container->setParameter('twig.config', $parameters);
}
示例2: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
$container->register('default_config_test.schema_storage')->setClass('\\Drupal\\config_test\\TestInstallStorage')->addArgument(InstallStorage::CONFIG_SCHEMA_DIRECTORY);
$definition = $container->getDefinition('config.typed');
$definition->replaceArgument(1, new Reference('default_config_test.schema_storage'));
}
示例3: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
// Some test methods involve ModuleHandler operations, which attempt to
// rebuild and dump routes.
$container->register('router.dumper', 'Drupal\\Core\\Routing\\NullMatcherDumper');
}
示例4: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
// Change container to database cache backends.
$container->register('cache_factory', 'Drupal\\Core\\Cache\\CacheFactory')->addArgument(new Reference('settings'))->addMethodCall('setContainer', [new Reference('service_container')]);
// Change container to use database lock backends.
$container->register('lock', 'Drupal\\Core\\Lock\\DatabaseLockBackend')->addArgument(new Reference('database'));
}
示例5: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
$container->register('stream_wrapper.private', 'Drupal\\Core\\StreamWrapper\\PrivateStream')->addTag('stream_wrapper', ['scheme' => 'private']);
if (isset($this->scheme)) {
$container->register('stream_wrapper.' . $this->scheme, $this->classname)->addTag('stream_wrapper', ['scheme' => $this->scheme]);
}
}
示例6: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
foreach ($this->providerTestCustomStreamWrappers() as $stream_wrapper) {
$scheme = $stream_wrapper[0];
$class = $stream_wrapper[2];
$container->register("stream_wrapper.{$scheme}", $class)->addTag('stream_wrapper', ['scheme' => $scheme]);
}
}
示例7: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
// \Drupal\KernelTests\KernelTestBase::register() removes the alias path
// processor.
if ($container->hasDefinition('path_processor_alias')) {
$definition = $container->getDefinition('path_processor_alias');
$definition->addTag('path_processor_inbound', ['priority' => 100])->addTag('path_processor_outbound', ['priority' => 300]);
}
}
示例8: register
/**
* {@inheritdoc}
*
* Register a database cache backend rather than memory-based.
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
$container->register('cache_factory', 'Drupal\\Core\\Cache\\DatabaseBackendFactory')->addArgument(new Reference('database'))->addArgument(new Reference('cache_tags.invalidator.checksum'));
}
示例9: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
$container->set('url_generator', new SupernovaGenerator());
}
示例10: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
$definition = $container->getDefinition('path_processor_alias');
$definition->addTag('path_processor_inbound', ['priority' => 100]);
}
示例11: register
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container)
{
parent::register($container);
// Readd the incoming path alias for these tests.
if ($container->hasDefinition('path_processor_alias')) {
$definition = $container->getDefinition('path_processor_alias');
$definition->addTag('path_processor_inbound');
}
}