Skip to content
Snippets Groups Projects
Commit 0325ab60 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2936435 by Berdir, alexpott: Better BC for deprecated container...

Issue #2936435 by Berdir, alexpott: Better BC for deprecated container parameter user.tempstore.expire
parent 4fbf9977
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -15,6 +15,11 @@ public function alter(ContainerBuilder $container) {
@trigger_error('The container parameter "user.tempstore.expire" is deprecated. Use "tempstore.expire" instead. See https://www.drupal.org/node/2935639.', E_USER_DEPRECATED);
$container->setParameter('tempstore.expire', $container->getParameter('user.tempstore.expire'));
}
else {
// Ensure the user.tempstore.expire parameter is set to the same value
// for modules that still rely on it.
$container->setParameter('user.tempstore.expire', $container->getParameter('tempstore.expire'));
}
}
}
<?php
namespace Drupal\Tests\user\Kernel;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests \Drupal\user\UserServiceProvider.
*
* @group user
* @group legacy
*/
class UserServiceProviderFallbackTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['user'];
/**
* Tests that user.tempstore.expire equals tempstore.expire if not customized.
*/
public function testUserServiceProvider() {
$this->assertEquals(1000, $this->container->getParameter('user.tempstore.expire'));
}
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
$container->setParameter('tempstore.expire', 1000);
parent::register($container);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment