Skip to content

Commit e0c7f0e

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: Fix some Composer keywords [FrameworkBundle] Rename limiter’s `strategy` to `policy` in XSD [VarDumper] Fixed dumping of CutStub Fix test Change limit argument from string to integer. [Messenger] Fix `evaluate()` calls in `WorkerTest` [Mailer] STDOUT blocks infinitely under Windows when STDERR is filled
2 parents e85ef24 + eee1a71 commit e0c7f0e

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@
776776
<xsd:attribute name="lock-factory" type="xsd:string" />
777777
<xsd:attribute name="storage-service" type="xsd:string" />
778778
<xsd:attribute name="cache-pool" type="xsd:string" />
779-
<xsd:attribute name="strategy" type="xsd:string" />
779+
<xsd:attribute name="policy" type="xsd:string" />
780780
<xsd:attribute name="limit" type="xsd:int" />
781781
<xsd:attribute name="interval" type="xsd:string" />
782782
</xsd:complexType>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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>

Tests/DependencyInjection/XmlFrameworkExtensionTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Config\FileLocator;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
17+
use Symfony\Component\RateLimiter\Policy\SlidingWindowLimiter;
1718

1819
class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase
1920
{
@@ -66,4 +67,11 @@ public function testLegacyExceptionsConfig()
6667
'status_code' => 500,
6768
], $configuration[\Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::class]);
6869
}
70+
71+
public function testRateLimiter()
72+
{
73+
$container = $this->createContainerFromFile('rate_limiter');
74+
75+
$this->assertTrue($container->hasDefinition('limiter.sliding_window'));
76+
}
6977
}

0 commit comments

Comments
 (0)