99 * file that was distributed with this source code.
1010 */
1111
12- namespace Symfony \Cmf \Bundle \ResourceRestBundle \Tests \Security ;
12+ namespace Symfony \Cmf \Bundle \ResourceRestBundle \Tests \Unit \ Security ;
1313
14+ use PHPUnit \Framework \TestCase ;
15+ use stdClass ;
1416use Symfony \Cmf \Bundle \ResourceRestBundle \Security \ResourcePathVoter ;
1517use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
1618use Symfony \Component \Security \Core \Authorization \AccessDecisionManagerInterface ;
1719use Symfony \Component \Security \Core \Authorization \Voter \Voter as V ;
1820
19- class ResourcePathVoterTest extends \PHPUnit_Framework_TestCase
21+ class ResourcePathVoterTest extends TestCase
2022{
2123 private $ accessDecisionManager ;
2224
23- protected function setUp ()
25+ protected function setUp (): void
2426 {
2527 $ this ->accessDecisionManager = $ this ->prophesize (AccessDecisionManagerInterface::class);
2628 }
@@ -37,7 +39,7 @@ public function testVote($rules, $subject, array $attributes, $result)
3739
3840 $ voter = new ResourcePathVoter ($ this ->accessDecisionManager ->reveal (), $ rules );
3941
40- $ this -> assertSame ($ result , $ voter ->vote ($ token , $ subject , $ attributes ));
42+ self :: assertSame ($ result , $ voter ->vote ($ token , $ subject , $ attributes ));
4143 }
4244
4345 public function provideVoteData ()
@@ -61,7 +63,7 @@ public function provideVoteData()
6163 // Unsupported attributes or subjects
6264 [[], $ this ->buildSubject ('/cms/articles ' ), ['CMF_RESOURCE_READ ' ], V::ACCESS_DENIED ],
6365 [[$ this ->buildRule ('^/ ' )], $ this ->buildSubject ('/cms/articles ' ), ['ROLE_USER ' ], V::ACCESS_ABSTAIN ],
64- [[$ this ->buildRule ('^/ ' )], new \ stdClass (), ['CMF_RESOURCE_READ ' ], V::ACCESS_ABSTAIN ],
66+ [[$ this ->buildRule ('^/ ' )], new stdClass (), ['CMF_RESOURCE_READ ' ], V::ACCESS_ABSTAIN ],
6567
6668 // Repository name matching
6769 [[$ this ->buildRule ('^/ ' )], $ this ->buildSubject ('/cms/articles ' , 'other_repo ' ), ['CMF_RESOURCE_READ ' ], V::ACCESS_DENIED ],
0 commit comments