summaryrefslogtreecommitdiffstats
path: root/tests/Components/LimitTest.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2016-02-21 22:53:00 +0200
committerDan Ungureanu <udan1107@gmail.com>2016-02-21 22:53:00 +0200
commitb4d9dab06c277b5dedaa9cf41eaac8e274098563 (patch)
treeb5a42381c908ad963edc63154435caf205130674 /tests/Components/LimitTest.php
parentad8407a13a8af04e9553b6c4e4068a4d5638bf72 (diff)
downloadsql-parser-b4d9dab06c277b5dedaa9cf41eaac8e274098563.zip
sql-parser-b4d9dab06c277b5dedaa9cf41eaac8e274098563.tar.gz
sql-parser-b4d9dab06c277b5dedaa9cf41eaac8e274098563.tar.bz2
Misc: Fixed coding style issues.
Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
Diffstat (limited to 'tests/Components/LimitTest.php')
-rw-r--r--tests/Components/LimitTest.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/Components/LimitTest.php b/tests/Components/LimitTest.php
new file mode 100644
index 0000000..bc5a462
--- /dev/null
+++ b/tests/Components/LimitTest.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('parser/parseLimitErr1'),
+ array('parser/parseLimitErr2'),
+ );
+ }
+}