File tree 4 files changed +53
-1
lines changed
Resources/Fixtures/config
4 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
4
4
5
+ # 1.26.0 - 2022-03-17
6
+
7
+ - Fixed you can now configure the cache plugin default_ttl with ` null ` .
8
+
5
9
# 1.25.0 - 2021-11-26
6
10
- Added PHP 8.1 support
7
11
- Added Symfony 6 support
Original file line number Diff line number Diff line change @@ -713,8 +713,14 @@ private function createCachePluginNode()
713
713
->integerNode ('cache_lifetime ' )
714
714
->info ('The minimum time we should store a cache item ' )
715
715
->end ()
716
- ->integerNode ('default_ttl ' )
716
+ ->scalarNode ('default_ttl ' )
717
717
->info ('The default max age of a Response ' )
718
+ ->validate ()
719
+ ->ifTrue (function ($ v ) {
720
+ return null !== $ v && !is_int ($ v );
721
+ })
722
+ ->thenInvalid ('default_ttl must be an integer or null, got %s ' )
723
+ ->end ()
718
724
->end ()
719
725
->arrayNode ('blacklisted_paths ' )
720
726
->info ('An array of regular expression patterns for paths not to be cached. Defaults to an empty array. ' )
Original file line number Diff line number Diff line change
1
+ httplug :
2
+ clients :
3
+ test :
4
+ plugins :
5
+ -
6
+ cache :
7
+ cache_pool : my_custom_cache_pull
8
+ config :
9
+ default_ttl : null
Original file line number Diff line number Diff line change @@ -453,4 +453,37 @@ public function testInvalidCapturedBodyLengthString(): void
453
453
$ this ->expectExceptionMessage ('The child node "captured_body_length" at path "httplug.profiling" must be an integer or null ' );
454
454
$ this ->assertProcessedConfigurationEquals ([], [$ file ]);
455
455
}
456
+
457
+ public function testNullDefaultTtl (): void
458
+ {
459
+ $ file = __DIR__ .'/../../Resources/Fixtures/config/ttl_null.yml ' ;
460
+ $ config = $ this ->emptyConfig ;
461
+ $ config ['clients ' ] = [
462
+ 'test ' => [
463
+ 'factory ' => 'httplug.factory.auto ' ,
464
+ 'service ' => null ,
465
+ 'public ' => null ,
466
+ 'flexible_client ' => false ,
467
+ 'http_methods_client ' => false ,
468
+ 'batch_client ' => false ,
469
+ 'config ' => [],
470
+ 'plugins ' => [
471
+ [
472
+ 'cache ' => [
473
+ 'config ' => [
474
+ 'default_ttl ' => null ,
475
+ 'blacklisted_paths ' => [],
476
+ 'methods ' => ['GET ' , 'HEAD ' ],
477
+ 'cache_listeners ' => [],
478
+ ],
479
+ 'cache_pool ' => 'my_custom_cache_pull ' ,
480
+ 'enabled ' => true ,
481
+ 'stream_factory ' => 'httplug.stream_factory ' ,
482
+ ],
483
+ ],
484
+ ],
485
+ ],
486
+ ];
487
+ $ this ->assertProcessedConfigurationEquals ($ config , [$ file ]);
488
+ }
456
489
}
You can’t perform that action at this time.
0 commit comments