public function error($msg = '', $str = '', $pos = 0, $code = 0) { $error = new LexerException($msg, $str, $pos, $code); if ($this->strict) { throw $error; } $this->errors[] = $error; }
/** * @expectedException SqlParser\Exceptions\LexerException * @expectedExceptionMessage strict error * @expectedExceptionCode 4 */ public function testErrorStrict() { $lexer = new Lexer(''); $lexer->strict = true; $lexer->error(__('strict error'), 'foo', 1, 4); }