Exemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $encrypter = new Encrypter(Key::createNewRandomKey());
     $config = $this->mock(ConfigContract::class);
     $config->shouldReceive('get')->with('cache.drivers', []);
     $config->shouldReceive('get')->with('cache.namespace');
     $manager = new SessionManager($config, $encrypter);
     $manager->setContainer(new ArrayContainer([JarContract::class => $this->mock(JarContract::class), CacheManagerContract::class => new CacheManager($config)]));
     $this->manager = $manager;
 }
 public static function createSessionManager(ContainerInterface $container) : SessionManager
 {
     $manager = new SessionManager($container->get(ConfigManager::class), $container->get(Encrypter::class));
     $manager->setContainer($container);
     return $manager;
 }