Skip to content

Commit ec69811

Browse files
committed
add a test for concat strings
1 parent 57f2a68 commit ec69811

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"type": "library",
55
"require": {
66
"php": ">=7.4",
7-
"ext-pdo": "*"
7+
"ext-pdo": "*",
8+
"ext-fileinfo": "*",
9+
"ext-intl": "*",
10+
"ext-json": "*",
11+
"ext-mbstring": "*"
812
},
913
"license": "MIT",
1014
"autoload": {
@@ -21,5 +25,8 @@
2125
"minimum-stability": "stable",
2226
"require-dev": {
2327
"phpunit/phpunit": "^9.5"
28+
},
29+
"scripts": {
30+
"test": "phpunit"
2431
}
2532
}

tests/SqlSelectTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,15 @@ public function testSelectSubStr()
374374
$this->assertSame([], $result->getParams());
375375
}
376376

377+
public function testSelectConcatStr()
378+
{
379+
$result = $this->qb->select("'Hello' || ' world!' as 'str'");
380+
381+
$this->assertSame(false, $result->hasError());
382+
$this->assertSame("SELECT 'Hello' || ' world!' as 'str'", $result->getSql());
383+
$this->assertSame([], $result->getParams());
384+
}
385+
377386
public function testSelectSqliteVersion()
378387
{
379388
$result = $this->qb->select("sqlite_version() as ver");

0 commit comments

Comments
 (0)