You are here

function DatabaseAnsiSyntaxTestCase::testBasicConcat in SimpleTest 7

Test for ANSI string concatenation.

File

tests/database_test.test, line 2547

Class

DatabaseAnsiSyntaxTestCase
Test how the current database driver interprets the SQL syntax.

Code

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