@@ -78,13 +78,13 @@ public function testIsGranted()
78
78
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
79
79
$ event = $ eventProphecy ->reveal ();
80
80
81
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
81
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
82
82
83
83
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
84
84
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
85
85
86
86
$ resourceAccessCheckerProphecy = $ this ->prophesize (ResourceAccessCheckerInterface::class);
87
- $ resourceAccessCheckerProphecy ->isGranted ('Foo ' , 'has_role ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (true )->shouldBeCalled ();
87
+ $ resourceAccessCheckerProphecy ->isGranted ('Foo ' , 'is_granted ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (true )->shouldBeCalled ();
88
88
89
89
$ listener = $ this ->getListener ($ resourceMetadataFactoryProphecy ->reveal (), $ resourceAccessCheckerProphecy ->reveal ());
90
90
$ listener ->onKernelRequest ($ event );
@@ -100,13 +100,13 @@ public function testIsNotGranted()
100
100
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
101
101
$ event = $ eventProphecy ->reveal ();
102
102
103
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
103
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
104
104
105
105
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
106
106
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
107
107
108
108
$ resourceAccessCheckerProphecy = $ this ->prophesize (ResourceAccessCheckerInterface::class);
109
- $ resourceAccessCheckerProphecy ->isGranted ('Foo ' , 'has_role ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (false )->shouldBeCalled ();
109
+ $ resourceAccessCheckerProphecy ->isGranted ('Foo ' , 'is_granted ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (false )->shouldBeCalled ();
110
110
111
111
$ listener = $ this ->getListener ($ resourceMetadataFactoryProphecy ->reveal (), $ resourceAccessCheckerProphecy ->reveal ());
112
112
$ listener ->onKernelRequest ($ event );
@@ -123,13 +123,13 @@ public function testAccessControlMessage()
123
123
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
124
124
$ event = $ eventProphecy ->reveal ();
125
125
126
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' , 'access_control_message ' => 'You are not admin. ' ]);
126
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' , 'access_control_message ' => 'You are not admin. ' ]);
127
127
128
128
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
129
129
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
130
130
131
131
$ resourceAccessCheckerProphecy = $ this ->prophesize (ResourceAccessCheckerInterface::class);
132
- $ resourceAccessCheckerProphecy ->isGranted ('Foo ' , 'has_role ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (false )->shouldBeCalled ();
132
+ $ resourceAccessCheckerProphecy ->isGranted ('Foo ' , 'is_granted ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (false )->shouldBeCalled ();
133
133
134
134
$ listener = $ this ->getListener ($ resourceMetadataFactoryProphecy ->reveal (), $ resourceAccessCheckerProphecy ->reveal ());
135
135
$ listener ->onKernelRequest ($ event );
@@ -147,13 +147,13 @@ public function testIsGrantedLegacy()
147
147
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
148
148
$ event = $ eventProphecy ->reveal ();
149
149
150
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
150
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
151
151
152
152
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
153
153
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
154
154
155
155
$ expressionLanguageProphecy = $ this ->prophesize (ExpressionLanguage::class);
156
- $ expressionLanguageProphecy ->evaluate ('has_role ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (true )->shouldBeCalled ();
156
+ $ expressionLanguageProphecy ->evaluate ('is_granted ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (true )->shouldBeCalled ();
157
157
158
158
$ listener = $ this ->getLegacyListener ($ resourceMetadataFactoryProphecy ->reveal (), $ expressionLanguageProphecy ->reveal ());
159
159
$ listener ->onKernelRequest ($ event );
@@ -172,13 +172,13 @@ public function testIsNotGrantedLegacy()
172
172
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
173
173
$ event = $ eventProphecy ->reveal ();
174
174
175
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
175
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
176
176
177
177
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
178
178
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
179
179
180
180
$ expressionLanguageProphecy = $ this ->prophesize (ExpressionLanguage::class);
181
- $ expressionLanguageProphecy ->evaluate ('has_role ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (false )->shouldBeCalled ();
181
+ $ expressionLanguageProphecy ->evaluate ('is_granted ("ROLE_ADMIN") ' , Argument::type ('array ' ))->willReturn (false )->shouldBeCalled ();
182
182
183
183
$ listener = $ this ->getLegacyListener ($ resourceMetadataFactoryProphecy ->reveal (), $ expressionLanguageProphecy ->reveal ());
184
184
$ listener ->onKernelRequest ($ event );
@@ -197,7 +197,7 @@ public function testSecurityComponentNotAvailable()
197
197
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
198
198
$ event = $ eventProphecy ->reveal ();
199
199
200
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
200
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
201
201
202
202
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
203
203
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
@@ -219,7 +219,7 @@ public function testExpressionLanguageNotInstalled()
219
219
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
220
220
$ event = $ eventProphecy ->reveal ();
221
221
222
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
222
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
223
223
224
224
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
225
225
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
@@ -245,7 +245,7 @@ public function testNotBehindAFirewall()
245
245
$ eventProphecy ->getRequest ()->willReturn ($ request )->shouldBeCalled ();
246
246
$ event = $ eventProphecy ->reveal ();
247
247
248
- $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'has_role ("ROLE_ADMIN") ' ]);
248
+ $ resourceMetadata = new ResourceMetadata (null , null , null , null , null , ['access_control ' => 'is_granted ("ROLE_ADMIN") ' ]);
249
249
250
250
$ resourceMetadataFactoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
251
251
$ resourceMetadataFactoryProphecy ->create ('Foo ' )->willReturn ($ resourceMetadata )->shouldBeCalled ();
0 commit comments