12
12
namespace Symfony \Component \CssSelector \Tests \Parser ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Bridge \PhpUnit \ForwardCompatTestTrait ;
15
16
use Symfony \Component \CssSelector \Parser \Token ;
16
17
use Symfony \Component \CssSelector \Parser \TokenStream ;
17
18
18
19
class TokenStreamTest extends TestCase
19
20
{
21
+ use ForwardCompatTestTrait;
22
+
20
23
public function testGetNext ()
21
24
{
22
25
$ stream = new TokenStream ();
@@ -53,7 +56,7 @@ public function testGetNextIdentifier()
53
56
54
57
public function testFailToGetNextIdentifier ()
55
58
{
56
- $ this ->{ method_exists ( $ this , $ _ = ' expectException ' ) ? $ _ : ' setExpectedException ' } ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
59
+ $ this ->expectException ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
57
60
58
61
$ stream = new TokenStream ();
59
62
$ stream ->push (new Token (Token::TYPE_DELIMITER , '. ' , 2 ));
@@ -73,7 +76,7 @@ public function testGetNextIdentifierOrStar()
73
76
74
77
public function testFailToGetNextIdentifierOrStar ()
75
78
{
76
- $ this ->{ method_exists ( $ this , $ _ = ' expectException ' ) ? $ _ : ' setExpectedException ' } ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
79
+ $ this ->expectException ('Symfony\Component\CssSelector\Exception\SyntaxErrorException ' );
77
80
78
81
$ stream = new TokenStream ();
79
82
$ stream ->push (new Token (Token::TYPE_DELIMITER , '. ' , 2 ));
0 commit comments