File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Security \Core \Tests \Authorization ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Bridge \PhpUnit \ForwardCompatTestTrait ;
15
16
use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
16
17
use Symfony \Component \Security \Core \Authorization \AccessDecisionManager ;
17
18
use Symfony \Component \Security \Core \Authorization \Voter \VoterInterface ;
20
21
21
22
class AccessDecisionManagerTest extends TestCase
22
23
{
24
+ use ForwardCompatTestTrait;
25
+
23
26
/**
24
27
* @expectedException \InvalidArgumentException
25
28
*/
@@ -147,12 +150,8 @@ public function testVotingWrongTypeNoVoteMethod()
147
150
$ exception = LogicException::class;
148
151
$ message = sprintf ('stdClass should implement the %s interface when used as voter. ' , VoterInterface::class);
149
152
150
- if (method_exists ($ this , 'expectException ' )) {
151
- $ this ->expectException ($ exception );
152
- $ this ->expectExceptionMessage ($ message );
153
- } else {
154
- $ this ->setExpectedException ($ exception , $ message );
155
- }
153
+ $ this ->expectException ($ exception );
154
+ $ this ->expectExceptionMessage ($ message );
156
155
157
156
$ adm = new AccessDecisionManager ([new \stdClass ()]);
158
157
$ token = $ this ->getMockBuilder (TokenInterface::class)->getMock ();
You can’t perform that action at this time.
0 commit comments