aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/DB/QueryBuilder/FunctionBuilderTest.php')
-rw-r--r--tests/lib/DB/QueryBuilder/FunctionBuilderTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php b/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
index 71ae3d5c7f6..b824b86fecf 100644
--- a/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
@@ -54,6 +54,32 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals('foobar', $column);
}
+ public function testGroupConcatWithoutSeparatorAndOrder() {
+ $query = $this->connection->getQueryBuilder();
+
+ $query->select($query->func()->groupConcat('appid'));
+ $query->from('appconfig')
+ ->setMaxResults(1);
+
+ $result = $query->execute();
+ $column = $result->fetchOne();
+ $result->closeCursor();
+ $this->assertGreaterThan(1, str_getcsv($column, ','));
+ }
+
+ public function testGroupConcatWithSeparatorAndOrder() {
+ $query = $this->connection->getQueryBuilder();
+
+ $query->select($query->func()->groupConcat('appid', '#', 'appid'));
+ $query->from('appconfig')
+ ->setMaxResults(1);
+
+ $result = $query->execute();
+ $column = $result->fetchOne();
+ $result->closeCursor();
+ $this->assertGreaterThan(1, str_getcsv($column, '#', 'appid'));
+ }
+
public function testMd5() {
$query = $this->connection->getQueryBuilder();