1212namespace Symfony \Component \CssSelector \Tests \Parser ;
1313
1414use PHPUnit \Framework \TestCase ;
15+ use Symfony \Bridge \PhpUnit \ForwardCompatTestTrait ;
1516use Symfony \Component \CssSelector \Parser \Token ;
1617use Symfony \Component \CssSelector \Parser \TokenStream ;
1718
1819class TokenStreamTest extends TestCase
1920{
21+ use ForwardCompatTestTrait;
22+
2023 public function testGetNext ()
2124 {
2225 $ stream = new TokenStream ();
@@ -53,7 +56,7 @@ public function testGetNextIdentifier()
5356
5457 public function testFailToGetNextIdentifier ()
5558 {
56- $ this ->{ method_exists ( $ this , $ _ = ' expectException ' ) ? $ _ : ' setExpectedException ' } ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
59+ $ this ->expectException ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
5760
5861 $ stream = new TokenStream ();
5962 $ stream ->push (new Token (Token::TYPE_DELIMITER , '. ' , 2 ));
@@ -73,7 +76,7 @@ public function testGetNextIdentifierOrStar()
7376
7477 public function testFailToGetNextIdentifierOrStar ()
7578 {
76- $ this ->{ method_exists ( $ this , $ _ = ' expectException ' ) ? $ _ : ' setExpectedException ' } ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
79+ $ this ->expectException ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
7780
7881 $ stream = new TokenStream ();
7982 $ stream ->push (new Token (Token::TYPE_DELIMITER , '. ' , 2 ));
0 commit comments