Skip to content

Commit 2fd9a08

Browse files
committed
simplified PHPUnit exception expectations
1 parent dacd599 commit 2fd9a08

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Tests/Parser/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testParseSeriesException($series)
8989

9090
/** @var FunctionNode $function */
9191
$function = $selectors[0]->getTree();
92-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
92+
$this->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
9393
Parser::parseSeries($function->getArguments());
9494
}
9595

Tests/Parser/TokenStreamTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testGetNextIdentifier()
5353

5454
public function testFailToGetNextIdentifier()
5555
{
56-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
56+
$this->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
5757

5858
$stream = new TokenStream();
5959
$stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
@@ -73,7 +73,7 @@ public function testGetNextIdentifierOrStar()
7373

7474
public function testFailToGetNextIdentifierOrStar()
7575
{
76-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
76+
$this->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
7777

7878
$stream = new TokenStream();
7979
$stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));

0 commit comments

Comments
 (0)