You are here

public function TransactionLegacyAPITest::testTransactionUpdateNew in Transaction 5

Verify the behavior of pressflow_transaction_update() for new rows.

File

tests/transaction_legacy.test, line 109
Contains the test for the pressflow_transaction legacy API provided in the transaction module (formerly pressflow_transaction).

Class

TransactionLegacyAPITest
Implements the test cases for the pressflow_transaction legacy API.

Code

public function testTransactionUpdateNew() {

  // First insert a new row and verify by query.
  pressflow_transaction_update(self::$table, 'id', array(
    'first_name' => 'Sammy',
    'last_name' => 'Davis',
    'status' => 1,
  ));
  $test = db_result(db_query('SELECT status FROM ' . self::$table . " WHERE first_name = 'Sammy' AND last_name = 'Davis'"));
  $msg = t('Inserting new row with pressflow_transaction_update : %s');
  $this
    ->assertEqual($test, 1, $msg);
}