summaryrefslogtreecommitdiffstats
path: root/tests/Builder/SelectStatementTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Builder/SelectStatementTest.php')
-rw-r--r--tests/Builder/SelectStatementTest.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/Builder/SelectStatementTest.php b/tests/Builder/SelectStatementTest.php
index 5d9836f..2c7350a 100644
--- a/tests/Builder/SelectStatementTest.php
+++ b/tests/Builder/SelectStatementTest.php
@@ -92,7 +92,7 @@ class SelectStatementTest extends TestCase
);
}
- public function testBuildGroupBy()
+ public function testBuilderGroupBy()
{
$query = 'SELECT COUNT(CustomerID), Country FROM Customers GROUP BY Country';
$parser = new Parser($query);
@@ -104,7 +104,7 @@ class SelectStatementTest extends TestCase
);
}
- public function testBuildIndexHint()
+ public function testBuilderIndexHint()
{
$query = 'SELECT * FROM address FORCE INDEX (idx_fk_city_id) IGNORE KEY FOR GROUP BY (a, b,c) WHERE city_id<0';
$parser = new Parser($query);
@@ -115,4 +115,16 @@ class SelectStatementTest extends TestCase
$stmt->build()
);
}
+
+ public function testBuilderSurroundedByParanthesisWithLimit()
+ {
+ $query = '(SELECT first_name FROM `actor` LIMIT 1, 2)';
+ $parser = new Parser($query);
+ $stmt = $parser->statements[0];
+
+ $this->assertEquals(
+ 'SELECT first_name FROM `actor` LIMIT 1, 2',
+ $stmt->build()
+ );
+ }
}