@@ -72,10 +72,7 @@ public function testThatSecurityVotersAreProcessedInPriorityOrder()
72
72
$ this ->assertCount (4 , $ refs );
73
73
}
74
74
75
- /**
76
- * Test that in debug mode, voters are correctly decorated.
77
- */
78
- public function testThatVotersAreDecoratedInDebugMode (): void
75
+ public function testThatVotersAreTraceableInDebugMode (): void
79
76
{
80
77
$ container = new ContainerBuilder ();
81
78
@@ -96,21 +93,18 @@ public function testThatVotersAreDecoratedInDebugMode(): void
96
93
$ compilerPass ->process ($ container );
97
94
98
95
$ def1 = $ container ->getDefinition ('debug.security.voter.voter1 ' );
99
- $ this ->assertEquals ( array ( ' voter1 ' , null , 0 ), $ def1 ->getDecoratedService (), 'voter1: wrong return from getDecoratedService ' );
100
- $ this ->assertEquals (new Reference ('debug.security.voter. voter1.inner ' ), $ def1 ->getArgument (0 ), 'voter1: wrong decorator argument ' );
96
+ $ this ->assertNull ( $ def1 ->getDecoratedService (), 'voter1: should not be decorated ' );
97
+ $ this ->assertEquals (new Reference ('voter1 ' ), $ def1 ->getArgument (0 ), 'voter1: wrong argument ' );
101
98
102
99
$ def2 = $ container ->getDefinition ('debug.security.voter.voter2 ' );
103
- $ this ->assertEquals ( array ( ' voter2 ' , null , 0 ), $ def2 ->getDecoratedService (), 'voter2: wrong return from getDecoratedService ' );
104
- $ this ->assertEquals (new Reference ('debug.security.voter. voter2.inner ' ), $ def2 ->getArgument (0 ), 'voter2: wrong decorator argument ' );
100
+ $ this ->assertNull ( $ def2 ->getDecoratedService (), 'voter2: should not be decorated ' );
101
+ $ this ->assertEquals (new Reference ('voter2 ' ), $ def2 ->getArgument (0 ), 'voter2: wrong argument ' );
105
102
106
103
$ voters = $ container ->findTaggedServiceIds ('security.voter ' );
107
104
$ this ->assertCount (2 , $ voters , 'Incorrect count of voters ' );
108
105
}
109
106
110
- /**
111
- * Test that voters are not decorated if the application is not in debug mode.
112
- */
113
- public function testThatVotersAreNotDecoratedWithoutDebugMode (): void
107
+ public function testThatVotersAreNotTraceableWithoutDebugMode (): void
114
108
{
115
109
$ container = new ContainerBuilder ();
116
110
$ container ->setParameter ('kernel.debug ' , false );
@@ -130,8 +124,8 @@ public function testThatVotersAreNotDecoratedWithoutDebugMode(): void
130
124
$ compilerPass = new AddSecurityVotersPass ();
131
125
$ compilerPass ->process ($ container );
132
126
133
- $ this ->assertFalse ($ container ->has ('debug.security.voter.voter1 ' ), 'voter1 should not be decorated ' );
134
- $ this ->assertFalse ($ container ->has ('debug.security.voter.voter2 ' ), 'voter2 should not be decorated ' );
127
+ $ this ->assertFalse ($ container ->has ('debug.security.voter.voter1 ' ), 'voter1 should not be traced ' );
128
+ $ this ->assertFalse ($ container ->has ('debug.security.voter.voter2 ' ), 'voter2 should not be traced ' );
135
129
}
136
130
137
131
/**
0 commit comments