9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
- namespace Symfony \Cmf \Bundle \ResourceRestBundle \Tests \Security ;
12
+ namespace Symfony \Cmf \Bundle \ResourceRestBundle \Tests \Unit \ Security ;
13
13
14
+ use PHPUnit \Framework \TestCase ;
15
+ use stdClass ;
14
16
use Symfony \Cmf \Bundle \ResourceRestBundle \Security \ResourcePathVoter ;
15
17
use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
16
18
use Symfony \Component \Security \Core \Authorization \AccessDecisionManagerInterface ;
17
19
use Symfony \Component \Security \Core \Authorization \Voter \Voter as V ;
18
20
19
- class ResourcePathVoterTest extends \PHPUnit_Framework_TestCase
21
+ class ResourcePathVoterTest extends TestCase
20
22
{
21
23
private $ accessDecisionManager ;
22
24
23
- protected function setUp ()
25
+ protected function setUp (): void
24
26
{
25
27
$ this ->accessDecisionManager = $ this ->prophesize (AccessDecisionManagerInterface::class);
26
28
}
@@ -37,7 +39,7 @@ public function testVote($rules, $subject, array $attributes, $result)
37
39
38
40
$ voter = new ResourcePathVoter ($ this ->accessDecisionManager ->reveal (), $ rules );
39
41
40
- $ this -> assertSame ($ result , $ voter ->vote ($ token , $ subject , $ attributes ));
42
+ self :: assertSame ($ result , $ voter ->vote ($ token , $ subject , $ attributes ));
41
43
}
42
44
43
45
public function provideVoteData ()
@@ -61,7 +63,7 @@ public function provideVoteData()
61
63
// Unsupported attributes or subjects
62
64
[[], $ this ->buildSubject ('/cms/articles ' ), ['CMF_RESOURCE_READ ' ], V::ACCESS_DENIED ],
63
65
[[$ 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 ],
65
67
66
68
// Repository name matching
67
69
[[$ this ->buildRule ('^/ ' )], $ this ->buildSubject ('/cms/articles ' , 'other_repo ' ), ['CMF_RESOURCE_READ ' ], V::ACCESS_DENIED ],
0 commit comments