1.20.x database_test.test | DatabaseBasicSyntaxTestCase::testConcatWsLiterals() |
Tests string concatenation with separator.
File
- modules/
simpletest/ tests/ database_test.test, line 3071 - Database tests.
Class
- DatabaseBasicSyntaxTestCase
- Test how the current database driver interprets the SQL syntax.
Code
function testConcatWsLiterals() {
$result = db_query("SELECT CONCAT_WS(', ', :a1, NULL, :a2, :a3, :a4)", array(
':a1' => 'Hello',
':a2' => NULL,
':a3' => '',
':a4' => 'world.',
));
$this->assertIdentical($result->fetchField(), 'Hello, , world.');
}