You are here

public function TransactionTest::testTransactionUpdateExisting in Transaction 5

Verify the behavior of transaction_update() for existing rows.

File

tests/transaction.test, line 126
Contains the test for the transaction module (formerly pressflow_transaction).

Class

TransactionTest
Implements the test cases for the transaction module.

Code

public function testTransactionUpdateExisting() {

  // Next update an existing row and verify by query.
  transaction_update(self::$table, array(
    'first_name',
    'last_name',
  ), array(
    'first_name' => 'John',
    'last_name' => 'Smith',
    'status' => 9,
  ));
  $test = db_result(db_query('SELECT status FROM ' . self::$table . " WHERE first_name = 'John' AND last_name = 'Smith'"));
  $msg = t('Updating existing row with transaction_update : %s');
  $this
    ->assertEqual($test, 9, $msg);
}