Commit c060f5de authored by alexpott's avatar alexpott

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

Issue #2936435 by Berdir, alexpott: Better BC for deprecated container parameter user.tempstore.expire

(cherry picked from commit 0325ab60)
parent dafa5f11
......@@ -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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment