Skip to content

Commit 4b56d1a

Browse files
committed
Use ::class keyword when possible
1 parent 8b9d78c commit 4b56d1a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Tests/CssSelectorConverterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testCssToXPathXml()
3737

3838
public function testParseExceptions()
3939
{
40-
$this->expectException('Symfony\Component\CssSelector\Exception\ParseException');
40+
$this->expectException(\Symfony\Component\CssSelector\Exception\ParseException::class);
4141
$this->expectExceptionMessage('Expected identifier, but <eof at 3> found.');
4242
$converter = new CssSelectorConverter();
4343
$converter->toXPath('h1:');

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->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
92+
$this->expectException(SyntaxErrorException::class);
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->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
56+
$this->expectException(\Symfony\Component\CssSelector\Exception\SyntaxErrorException::class);
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->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
76+
$this->expectException(\Symfony\Component\CssSelector\Exception\SyntaxErrorException::class);
7777

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

Tests/XPath/TranslatorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ public function testCssToXPath($css, $xpath)
3737

3838
public function testCssToXPathPseudoElement()
3939
{
40-
$this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException');
40+
$this->expectException(\Symfony\Component\CssSelector\Exception\ExpressionErrorException::class);
4141
$translator = new Translator();
4242
$translator->registerExtension(new HtmlExtension($translator));
4343
$translator->cssToXPath('e::first-line');
4444
}
4545

4646
public function testGetExtensionNotExistsExtension()
4747
{
48-
$this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException');
48+
$this->expectException(\Symfony\Component\CssSelector\Exception\ExpressionErrorException::class);
4949
$translator = new Translator();
5050
$translator->registerExtension(new HtmlExtension($translator));
5151
$translator->getExtension('fake');
5252
}
5353

5454
public function testAddCombinationNotExistsExtension()
5555
{
56-
$this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException');
56+
$this->expectException(\Symfony\Component\CssSelector\Exception\ExpressionErrorException::class);
5757
$translator = new Translator();
5858
$translator->registerExtension(new HtmlExtension($translator));
5959
$parser = new Parser();
@@ -64,7 +64,7 @@ public function testAddCombinationNotExistsExtension()
6464

6565
public function testAddFunctionNotExistsFunction()
6666
{
67-
$this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException');
67+
$this->expectException(\Symfony\Component\CssSelector\Exception\ExpressionErrorException::class);
6868
$translator = new Translator();
6969
$translator->registerExtension(new HtmlExtension($translator));
7070
$xpath = new XPathExpr();
@@ -74,7 +74,7 @@ public function testAddFunctionNotExistsFunction()
7474

7575
public function testAddPseudoClassNotExistsClass()
7676
{
77-
$this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException');
77+
$this->expectException(\Symfony\Component\CssSelector\Exception\ExpressionErrorException::class);
7878
$translator = new Translator();
7979
$translator->registerExtension(new HtmlExtension($translator));
8080
$xpath = new XPathExpr();
@@ -83,7 +83,7 @@ public function testAddPseudoClassNotExistsClass()
8383

8484
public function testAddAttributeMatchingClassNotExistsClass()
8585
{
86-
$this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException');
86+
$this->expectException(\Symfony\Component\CssSelector\Exception\ExpressionErrorException::class);
8787
$translator = new Translator();
8888
$translator->registerExtension(new HtmlExtension($translator));
8989
$xpath = new XPathExpr();

0 commit comments

Comments
 (0)