summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/database_test.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-05-28 10:13:38 +0000
committerDries Buytaert <dries@buytaert.net>2010-05-28 10:13:38 +0000
commitf5d08f5e82e899b0c6db1dbd04d5371c764796c6 (patch)
tree982af830ec0b4b7d94e3338fca55e20822c19c6e /modules/simpletest/tests/database_test.test
parent9a67fb99ef23facf62151974a9c553ca68888281 (diff)
downloadbrdo-f5d08f5e82e899b0c6db1dbd04d5371c764796c6.tar.gz
brdo-f5d08f5e82e899b0c6db1dbd04d5371c764796c6.tar.bz2
- Patch #809698 by Damien Tournoud, tstoeckler: refrain from using the || operator for concatenation.
Diffstat (limited to 'modules/simpletest/tests/database_test.test')
-rw-r--r--modules/simpletest/tests/database_test.test18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index b64b5bd81..a03ba06b4 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -2703,11 +2703,11 @@ class DatabaseTemporaryQueryTestCase extends DrupalWebTestCase {
* across multiple kinds of database systems, we test that the
* database system interprets SQL syntax in an expected fashion.
*/
-class DatabaseAnsiSyntaxTestCase extends DatabaseTestCase {
+class DatabaseBasicSyntaxTestCase extends DatabaseTestCase {
public static function getInfo() {
return array(
- 'name' => 'ANSI SQL syntax tests',
- 'description' => 'Test ANSI SQL syntax interpretation.',
+ 'name' => 'Basic SQL syntax tests',
+ 'description' => 'Test SQL syntax interpretation.',
'group' => 'Database',
);
}
@@ -2717,30 +2717,30 @@ class DatabaseAnsiSyntaxTestCase extends DatabaseTestCase {
}
/**
- * Test for ANSI string concatenation.
+ * Test for string concatenation.
*/
function testBasicConcat() {
- $result = db_query('SELECT :a1 || :a2 || :a3 || :a4 || :a5', array(
+ $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.', t('Basic ANSI Concat works.'));
+ $this->assertIdentical($result->fetchField(), 'This is a test.', t('Basic CONCAT works.'));
}
/**
- * Test for ANSI string concatenation with field values.
+ * Test for string concatenation with field values.
*/
function testFieldConcat() {
- $result = db_query('SELECT :a1 || name || :a2 || age || :a3 FROM {test} WHERE age = :age', array(
+ $result = db_query('SELECT CONCAT(:a1, CONCAT(name, CONCAT(:a2, CONCAT(age, :a3)))) FROM {test} WHERE age = :age', array(
':a1' => 'The age of ',
':a2' => ' is ',
':a3' => '.',
':age' => 25,
));
- $this->assertIdentical($result->fetchField(), 'The age of John is 25.', t('Field ANSI Concat works.'));
+ $this->assertIdentical($result->fetchField(), 'The age of John is 25.', t('Field CONCAT works.'));
}
/**