function BasicSyntaxTest::testConcatWsLiterals
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php \Drupal\KernelTests\Core\Database\BasicSyntaxTest::testConcatWsLiterals()
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php \Drupal\KernelTests\Core\Database\BasicSyntaxTest::testConcatWsLiterals()
- 10 core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php \Drupal\KernelTests\Core\Database\BasicSyntaxTest::testConcatWsLiterals()
Tests string concatenation with separator.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ BasicSyntaxTest.php, line 55
Class
- BasicSyntaxTest
- Tests SQL syntax interpretation.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testConcatWsLiterals() : void {
$result = $this->connection
->query("SELECT CONCAT_WS(', ', :a1, NULL, :a2, :a3, :a4)", [
':a1' => 'Hello',
':a2' => NULL,
':a3' => '',
':a4' => 'world.',
]);
$this->assertSame('Hello, , world.', $result->fetchField());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.