@@ -118,25 +118,31 @@ public function testNotGranted(): void
118118
119119 public function testNoSecurityBundleInstalled (): void
120120 {
121+ $ this ->securityPostDenormalizeStage = new SecurityPostDenormalizeStage ($ this ->resourceMetadataFactoryProphecy ->reveal (), null );
122+
121123 $ operationName = 'item_query ' ;
122124 $ resourceClass = 'myResource ' ;
123125 $ 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+ ]);
130129 $ this ->resourceMetadataFactoryProphecy ->create ($ resourceClass )->willReturn ($ resourceMetadata );
131130
131+ $ this ->expectException (\LogicException::class);
132+
133+ ($ this ->securityPostDenormalizeStage )($ resourceClass , 'item_query ' , []);
134+ }
135+
136+ public function testNoSecurityBundleInstalledNoExpression (): void
137+ {
132138 $ this ->securityPostDenormalizeStage = new SecurityPostDenormalizeStage ($ this ->resourceMetadataFactoryProphecy ->reveal (), null );
133139
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 );
136143
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 ' , []);
141147 }
142148}
0 commit comments