parse() public method

public parse ( $string )
Beispiel #1
0
 public function testParseExceptions()
 {
     $parser = new Parser();
     try {
         $parser->parse('h1:');
         $this->fail('->parse() throws an Exception if the css selector is not valid');
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\Symfony\\Component\\CssSelector\\SyntaxError', $e, '->parse() throws an Exception if the css selector is not valid');
         $this->assertEquals("Expected symbol, got '' at h1: -> ", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid');
     }
 }