File tree 2 files changed +8
-2
lines changed
src/Symfony/Bundle/FrameworkBundle
Tests/DependencyInjection
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,12 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
470
470
$ rootNode
471
471
->children ()
472
472
->arrayNode ('session ' )
473
+ ->validate ()
474
+ ->ifTrue (function ($ v ) {
475
+ return empty ($ v ['handler_id ' ]) && !empty ($ v ['save_path ' ]);
476
+ })
477
+ ->thenInvalid ('Session save path is ignored without a handler service ' )
478
+ ->end ()
473
479
->info ('session configuration ' )
474
480
->canBeEnabled ()
475
481
->children ()
Original file line number Diff line number Diff line change 24
24
use Symfony \Component \Cache \Adapter \FilesystemAdapter ;
25
25
use Symfony \Component \Cache \Adapter \ProxyAdapter ;
26
26
use Symfony \Component \Cache \Adapter \RedisAdapter ;
27
+ use Symfony \Component \Config \Definition \Exception \InvalidConfigurationException ;
27
28
use Symfony \Component \DependencyInjection \ChildDefinition ;
28
29
use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
29
30
use Symfony \Component \DependencyInjection \ContainerBuilder ;
30
31
use Symfony \Component \DependencyInjection \ContainerInterface ;
31
32
use Symfony \Component \DependencyInjection \Definition ;
32
- use Symfony \Component \DependencyInjection \Exception \LogicException ;
33
33
use Symfony \Component \DependencyInjection \Loader \ClosureLoader ;
34
34
use Symfony \Component \DependencyInjection \ParameterBag \ParameterBag ;
35
35
use Symfony \Component \DependencyInjection \Reference ;
@@ -477,7 +477,7 @@ public function testNullSessionHandler()
477
477
478
478
public function testNullSessionHandlerWithSavePath ()
479
479
{
480
- $ this ->expectException (LogicException ::class);
480
+ $ this ->expectException (InvalidConfigurationException ::class);
481
481
$ this ->createContainerFromFile ('session_savepath ' );
482
482
}
483
483
You can’t perform that action at this time.
0 commit comments