summaryrefslogtreecommitdiffstats
path: root/tests/Parser/ParserTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Parser/ParserTest.php')
-rw-r--r--tests/Parser/ParserTest.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php
index 82052a2..1cd5e2d 100644
--- a/tests/Parser/ParserTest.php
+++ b/tests/Parser/ParserTest.php
@@ -49,13 +49,31 @@ class ParserTest extends TestCase
$this->assertEquals(
$parser->errors,
array(
- new ParserException('error #1', new Token('foo'), 1),
- new ParserException('error #2', new Token('bar'), 2),
+ new ParserException('error #1', new Token('foo'), 1),
+ new ParserException('error #2', new Token('bar'), 2),
)
);
}
/**
+ * @runInSeparateProcess
+ * @preserveGlobalState disabled
+ */
+ public function testErrorTranslate()
+ {
+ define('TRANSLATE', '\\SqlParser\\Tests\\translate');
+
+ $parser = new Parser(new TokensList());
+
+ $parser->error('TO_TRANSLATE', null);
+
+ $this->assertEquals(
+ $parser->errors,
+ array(new ParserException('***', null, 0))
+ );
+ }
+
+ /**
* @expectedException SqlParser\Exceptions\ParserException
* @expectedExceptionMessage strict error
* @expectedExceptionCode 3