summaryrefslogtreecommitdiffstats
path: root/tests/Components/LimitKeywordTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Components/LimitKeywordTest.php')
-rw-r--r--tests/Components/LimitKeywordTest.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/Components/LimitKeywordTest.php b/tests/Components/LimitKeywordTest.php
new file mode 100644
index 0000000..ce9a760
--- /dev/null
+++ b/tests/Components/LimitKeywordTest.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace SqlParser\Tests\Components;
+
+use SqlParser\Parser;
+use SqlParser\Components\Limit;
+
+use SqlParser\Tests\TestCase;
+
+class LimitTest extends TestCase
+{
+
+ public function testBuild()
+ {
+ $component = new Limit(1);
+ $this->assertEquals(Limit::build($component), '1');
+ }
+
+ public function testBuildWithOffset()
+ {
+ $component = new Limit(1, 2);
+ $this->assertEquals(Limit::build($component), '2, 1');
+ }
+
+ /**
+ * @dataProvider testParseProvider
+ */
+ public function testParse($test)
+ {
+ $this->runParserTest($test);
+ }
+
+ public function testParseProvider()
+ {
+ return array(
+ array('parseLimitErr1'),
+ array('parseLimitErr2'),
+ );
+ }
+}