summaryrefslogtreecommitdiffstats
path: root/tests/Parser/ParserTest.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-21 14:05:03 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-21 14:05:03 +0300
commitf2ffbff424154aeb8767254e13b24d7bbeae366c (patch)
tree533bf05296306fffedf87f2599090adb6d1709a3 /tests/Parser/ParserTest.php
parente5fc8680b2069da1ddf3f872b33c831a72b299e9 (diff)
downloadsql-parser-f2ffbff424154aeb8767254e13b24d7bbeae366c.zip
sql-parser-f2ffbff424154aeb8767254e13b24d7bbeae366c.tar.gz
sql-parser-f2ffbff424154aeb8767254e13b24d7bbeae366c.tar.bz2
Refactoring.
Improved localization tests.
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