1 database_test.test DatabaseUpdateTestCase::testExpressionUpdate()

Test updating with expressions.

File

core/modules/simpletest/tests/database_test.test, line 828
Database tests.

Class

DatabaseUpdateTestCase
Update builder tests.

Code

function testExpressionUpdate() {
  // Ensure that expressions are handled properly. This should set every
  // record's age to a square of itself
  $num_rows = db_update('test')
    ->expression('age', 'age * age')
    ->execute();
  $this->assertIdentical($num_rows, 4, 'Updated 4 records.');
}