function SyntaxTest::testConcatWsFields
Tests string concatenation with separator, with field values.
Overrides DriverSpecificSyntaxTestBase::testConcatWsFields
File
-
core/
modules/ mysqli/ tests/ src/ Kernel/ mysqli/ SyntaxTest.php, line 19
Class
- SyntaxTest
- Tests MySql syntax interpretation.
Namespace
Drupal\Tests\mysqli\Kernel\mysqliCode
public function testConcatWsFields() : void {
$result = $this->connection
->query("SELECT CONCAT_WS('-', CONVERT(:a1 USING utf8mb4), [name], CONVERT(:a2 USING utf8mb4), [age]) FROM {test} WHERE [age] = :age", [
':a1' => 'name',
':a2' => 'age',
':age' => 25,
]);
$this->assertSame('name-John-age-25', $result->fetchField());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.