summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2017-08-30 11:54:44 +0200
committerMichal Čihař <michal@cihar.com>2017-08-30 11:54:44 +0200
commitee792ab0873eba52151e624c37d0a381ce47c3e3 (patch)
tree441bd48f365a5f99b70a5e2f12a2b041f624b40a /tests
parentf5d0084c09fe261f941bdb8ecfbe4835fc7a5a85 (diff)
downloadsql-parser-ee792ab0873eba52151e624c37d0a381ce47c3e3.zip
sql-parser-ee792ab0873eba52151e624c37d0a381ce47c3e3.tar.gz
sql-parser-ee792ab0873eba52151e624c37d0a381ce47c3e3.tar.bz2
Test loading all contexts
Issue #2 Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Lexer/ContextTest.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/Lexer/ContextTest.php b/tests/Lexer/ContextTest.php
index 6ce535f..caad004 100644
--- a/tests/Lexer/ContextTest.php
+++ b/tests/Lexer/ContextTest.php
@@ -32,6 +32,33 @@ class ContextTest extends TestCase
}
/**
+ * @dataProvider contextNames
+ */
+ public function testLoadAll($context)
+ {
+ Context::load($context);
+ $this->assertEquals('\\PhpMyAdmin\\SqlParser\\Contexts\\Context' . $context, Context::$loadedContext);
+
+ // Restoring context.
+ Context::load('');
+ }
+
+ public function contextNames()
+ {
+ return array(
+ array('MySql50000'),
+ array('MySql50100'),
+ array('MySql50500'),
+ array('MySql50600'),
+ array('MySql50700'),
+ array('MySql80000'),
+ array('MariaDb100000'),
+ array('MariaDb100100'),
+ array('MariaDb100200'),
+ );
+ }
+
+ /**
* @expectedException \Exception
* @expectedExceptionMessage Specified context ("\PhpMyAdmin\SqlParser\Contexts\ContextFoo") does not exist.
*/