You are here

public function CssSelectorTest::testParseExceptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/css-selector/Tests/CssSelectorTest.php \Symfony\Component\CssSelector\Tests\CssSelectorTest::testParseExceptions()

File

vendor/symfony/css-selector/Tests/CssSelectorTest.php, line 33

Class

CssSelectorTest

Namespace

Symfony\Component\CssSelector\Tests

Code

public function testParseExceptions() {
  try {
    CssSelector::toXPath('h1:');
    $this
      ->fail('->parse() throws an Exception if the css selector is not valid');
  } catch (\Exception $e) {
    $this
      ->assertInstanceOf('\\Symfony\\Component\\CssSelector\\Exception\\ParseException', $e, '->parse() throws an Exception if the css selector is not valid');
    $this
      ->assertEquals('Expected identifier, but <eof at 3> found.', $e
      ->getMessage(), '->parse() throws an Exception if the css selector is not valid');
  }
}