@@ -118,25 +118,31 @@ public function testNotGranted(): void
118
118
119
119
public function testNoSecurityBundleInstalled (): void
120
120
{
121
+ $ this ->securityPostDenormalizeStage = new SecurityPostDenormalizeStage ($ this ->resourceMetadataFactoryProphecy ->reveal (), null );
122
+
121
123
$ operationName = 'item_query ' ;
122
124
$ resourceClass = 'myResource ' ;
123
125
$ isGranted = 'not_granted ' ;
124
- $ extraVariables = ['extra ' => false ];
125
- $ resourceMetadata = (new ResourceMetadata ())->withGraphql (
126
- [
127
- $ operationName => ['security_post_denormalize ' => $ isGranted ],
128
- ]
129
- );
126
+ $ resourceMetadata = (new ResourceMetadata ())->withGraphql ([
127
+ $ operationName => ['security_post_denormalize ' => $ isGranted ],
128
+ ]);
130
129
$ this ->resourceMetadataFactoryProphecy ->create ($ resourceClass )->willReturn ($ resourceMetadata );
131
130
131
+ $ this ->expectException (\LogicException::class);
132
+
133
+ ($ this ->securityPostDenormalizeStage )($ resourceClass , 'item_query ' , []);
134
+ }
135
+
136
+ public function testNoSecurityBundleInstalledNoExpression (): void
137
+ {
132
138
$ this ->securityPostDenormalizeStage = new SecurityPostDenormalizeStage ($ this ->resourceMetadataFactoryProphecy ->reveal (), null );
133
139
134
- $ info = $ this ->prophesize (ResolveInfo::class)->reveal ();
135
- $ this ->expectException (\LogicException::class);
140
+ $ resourceClass = 'myResource ' ;
141
+ $ resourceMetadata = new ResourceMetadata ();
142
+ $ this ->resourceMetadataFactoryProphecy ->create ($ resourceClass )->willReturn ($ resourceMetadata );
136
143
137
- ($ this ->securityPostDenormalizeStage )($ resourceClass ,'item_query ' , [
138
- 'info ' => $ info ,
139
- 'extra_variables ' => $ extraVariables ,
140
- ]);
144
+ $ this ->resourceAccessCheckerProphecy ->isGranted (Argument::any ())->shouldNotBeCalled ();
145
+
146
+ ($ this ->securityPostDenormalizeStage )($ resourceClass , 'item_query ' , []);
141
147
}
142
148
}
0 commit comments