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 1212namespace Symfony \Component \Security \Core \Tests \Authorization ;
1313
1414use PHPUnit \Framework \TestCase ;
15+ use Symfony \Bridge \PhpUnit \ForwardCompatTestTrait ;
1516use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
1617use Symfony \Component \Security \Core \Authorization \AccessDecisionManager ;
1718use Symfony \Component \Security \Core \Authorization \Voter \VoterInterface ;
2021
2122class AccessDecisionManagerTest extends TestCase
2223{
24+ use ForwardCompatTestTrait;
25+
2326 /**
2427 * @expectedException \InvalidArgumentException
2528 */
@@ -147,12 +150,8 @@ public function testVotingWrongTypeNoVoteMethod()
147150 $ exception = LogicException::class;
148151 $ message = sprintf ('stdClass should implement the %s interface when used as voter. ' , VoterInterface::class);
149152
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 );
156155
157156 $ adm = new AccessDecisionManager ([new \stdClass ()]);
158157 $ token = $ this ->getMockBuilder (TokenInterface::class)->getMock ();
You can’t perform that action at this time.
0 commit comments