You are here

public function TransactionLegacyAPITest::testTransactionDBNextID in Transaction 5

Verify the operation of pressflow_transaction_db_next_id().

File

tests/transaction_legacy.test, line 91
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 testTransactionDBNextID() {

  // First check that it works correctly on the sequence created in setUp().
  $current = db_result(db_query("SELECT id FROM {sequences} WHERE name = '%s'", db_prefix_tables(self::$sequence1)));
  $test = pressflow_transaction_db_next_id(self::$sequence1);
  $msg = t('Next ID on existing sequence : %s');
  $this
    ->assertEqual($test, $current + 1, $msg);

  // Now create a new sequence and verify it was created.
  $second = pressflow_transaction_db_next_id(self::$sequence2);
  $test = db_next_id(self::$sequence2);
  $msg = t('Next ID on new sequence : %s');
  $this
    ->assertEqual($test, 2, $msg);
}