From c19711c02700397abb23799150b503b72f1d923f Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Mon, 13 Mar 2023 16:17:20 +0100 Subject: [PATCH] =?UTF-8?q?[FrameworkBundle]=20Rename=20limiter=E2=80=99s?= =?UTF-8?q?=20`strategy`=20to=20`policy`=20in=20XSD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/config/schema/symfony-1.0.xsd | 2 +- .../Fixtures/xml/rate_limiter.xml | 19 +++++++++++++++++++ .../XmlFrameworkExtensionTest.php | 8 ++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index d4be9fb6f2b7f..4366cab50d64b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -748,7 +748,7 @@ - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml new file mode 100644 index 0000000000000..35488c853cf5e --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php index 944e19709e5b1..4a2ff788bf5c6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php @@ -14,6 +14,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\RateLimiter\Policy\SlidingWindowLimiter; class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase { @@ -66,4 +67,11 @@ public function testLegacyExceptionsConfig() 'status_code' => 500, ], $configuration[\Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::class]); } + + public function testRateLimiter() + { + $container = $this->createContainerFromFile('rate_limiter'); + + $this->assertTrue($container->hasDefinition('limiter.sliding_window')); + } }