summaryrefslogtreecommitdiffstats
path: root/tests/Components/GroupKeywordTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Components/GroupKeywordTest.php')
-rw-r--r--tests/Components/GroupKeywordTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Components/GroupKeywordTest.php b/tests/Components/GroupKeywordTest.php
new file mode 100644
index 0000000..515de6b
--- /dev/null
+++ b/tests/Components/GroupKeywordTest.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace PhpMyAdmin\SqlParser\Tests\Components;
+
+use PhpMyAdmin\SqlParser\Components\Expression;
+use PhpMyAdmin\SqlParser\Components\GroupKeyword;
+use PhpMyAdmin\SqlParser\Tests\TestCase;
+
+class GroupKeywordTest extends TestCase
+{
+ public function testBuild()
+ {
+ $this->assertEquals(
+ GroupKeyword::build(
+ array(
+ new GroupKeyword(new Expression('a'), 'ASC'),
+ new GroupKeyword(new Expression('b'), 'DESC'),
+ new GroupKeyword(new Expression('c')),
+ )
+ ),
+ 'a ASC, b DESC, c'
+ );
+ }
+}