4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\EventListener;
14 use Psr\Container\ContainerInterface;
17 * Sets the session in the request.
19 * @author Fabien Potencier <fabien@symfony.com>
21 * @final since version 3.3
23 class TestSessionListener extends AbstractTestSessionListener
27 public function __construct(ContainerInterface $container)
29 $this->container = $container;
32 protected function getSession()
34 if (!$this->container->has('session')) {
38 return $this->container->get('session');