function BasicSyntaxTest::testBasicConcat

Tests string concatenation.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Database/BasicSyntaxTest.php, line 29
Definition of Drupal\system\Tests\Database\BasicSyntaxTest.

Class

BasicSyntaxTest
Tests how the current database driver interprets the SQL syntax.

Namespace

Drupal\system\Tests\Database

Code

function testBasicConcat() {
  $result = db_query('SELECT CONCAT(:a1, CONCAT(:a2, CONCAT(:a3, CONCAT(:a4, :a5))))', array(
    ':a1' => 'This',
    ':a2' => ' ',
    ':a3' => 'is',
    ':a4' => ' a ',
    ':a5' => 'test.',
  ));
  $this
    ->assertIdentical($result
    ->fetchField(), 'This is a test.', 'Basic CONCAT works.');
}