Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc3b94c

Browse files
minor#29169 [SecurityBundle] unhide debug security voter services (fmata)
This PR was merged into the 4.2-dev branch.Discussion----------[SecurityBundle] unhide debug security voter services| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| License | MIT#27914 introduces `testThatVotersAreNotDecoratedWithoutDebugMode()` which tests if decorated services exist but uses a bad service name without starting dot.Definition in the compiler pass :https://github.com/symfony/symfony/blob/a4204cd685c02377e6e2fbfc7ece98b5563644d9/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php#L58-L66The expected services are hidden and their name start with a dot. So the test will always pass, now it can fails :)Commits-------4677bb4 [SecurityBundle] unhide debug security voter services
2 parentsa4204cd +4677bb4 commitcc3b94c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function process(ContainerBuilder $container)
5757

5858
if ($debug) {
5959
// Decorate original voters with TraceableVoter
60-
$debugVoterServiceId ='.debug.security.voter.'.$voterServiceId;
60+
$debugVoterServiceId ='debug.security.voter.'.$voterServiceId;
6161
$container
6262
->register($debugVoterServiceId, TraceableVoter::class)
6363
->setDecoratedService($voterServiceId)

‎src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ public function testThatVotersAreDecoratedInDebugMode(): void
9595
$compilerPass =newAddSecurityVotersPass();
9696
$compilerPass->process($container);
9797

98-
$def1 =$container->getDefinition('.debug.security.voter.voter1');
98+
$def1 =$container->getDefinition('debug.security.voter.voter1');
9999
$this->assertEquals(array('voter1',null,0),$def1->getDecoratedService(),'voter1: wrong return from getDecoratedService');
100-
$this->assertEquals(newReference('.debug.security.voter.voter1.inner'),$def1->getArgument(0),'voter1: wrong decorator argument');
100+
$this->assertEquals(newReference('debug.security.voter.voter1.inner'),$def1->getArgument(0),'voter1: wrong decorator argument');
101101

102-
$def2 =$container->getDefinition('.debug.security.voter.voter2');
102+
$def2 =$container->getDefinition('debug.security.voter.voter2');
103103
$this->assertEquals(array('voter2',null,0),$def2->getDecoratedService(),'voter2: wrong return from getDecoratedService');
104-
$this->assertEquals(newReference('.debug.security.voter.voter2.inner'),$def2->getArgument(0),'voter2: wrong decorator argument');
104+
$this->assertEquals(newReference('debug.security.voter.voter2.inner'),$def2->getArgument(0),'voter2: wrong decorator argument');
105105

106106
$voters =$container->findTaggedServiceIds('security.voter');
107107
$this->assertCount(2,$voters,'Incorrect count of voters');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp