File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Tests/DependencyInjection Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 748
748
<xsd : attribute name =" lock-factory" type =" xsd:string" />
749
749
<xsd : attribute name =" storage-service" type =" xsd:string" />
750
750
<xsd : attribute name =" cache-pool" type =" xsd:string" />
751
- <xsd : attribute name =" strategy " type =" xsd:string" />
751
+ <xsd : attribute name =" policy " type =" xsd:string" />
752
752
<xsd : attribute name =" limit" type =" xsd:int" />
753
753
<xsd : attribute name =" interval" type =" xsd:string" />
754
754
</xsd : complexType >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+
3
+ <container xmlns =" http://symfony.com/schema/dic/services"
4
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
6
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
7
+ http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
8
+
9
+ <framework : config >
10
+ <framework : rate-limiter >
11
+ <framework : limiter
12
+ name =" sliding_window"
13
+ policy =" sliding_window"
14
+ limit =" 30"
15
+ lock-factory =" null"
16
+ />
17
+ </framework : rate-limiter >
18
+ </framework : config >
19
+ </container >
Original file line number Diff line number Diff line change 14
14
use Symfony \Component \Config \FileLocator ;
15
15
use Symfony \Component \DependencyInjection \ContainerBuilder ;
16
16
use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
17
+ use Symfony \Component \RateLimiter \Policy \SlidingWindowLimiter ;
17
18
18
19
class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase
19
20
{
@@ -66,4 +67,11 @@ public function testLegacyExceptionsConfig()
66
67
'status_code ' => 500 ,
67
68
], $ configuration [\Symfony \Component \HttpKernel \Exception \ServiceUnavailableHttpException::class]);
68
69
}
70
+
71
+ public function testRateLimiter ()
72
+ {
73
+ $ container = $ this ->createContainerFromFile ('rate_limiter ' );
74
+
75
+ $ this ->assertTrue ($ container ->hasDefinition ('limiter.sliding_window ' ));
76
+ }
69
77
}
You can’t perform that action at this time.
0 commit comments