public function TransactionLegacyAPITest::setUp in Transaction 5
Initialize the test.
File
- tests/
transaction_legacy.test, line 53 - 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 setUp() {
parent::setUp();
// Create a dummy table to test transactions on.
db_query('DROP TABLE IF EXISTS {simpletest_transaction}');
db_query('CREATE TABLE {simpletest_transaction} (
id int(10) UNSIGNED NOT NULL,
first_name varchar(32),
last_name varchar(32),
status tinyint(1) UNSIGNED NOT NULL,
PRIMARY KEY (id)
) /*!40100 DEFAULT CHARACTER SET UTF8 */');
// Populate the dummy table with data.
foreach (self::$test_data as $row) {
$id = db_next_id('{simpletest_transaction}_id');
db_query("INSERT INTO {simpletest_transaction}\n (id, first_name, last_name, status)\n VALUES (%d, '%s', '%s', %d)", $id, $row[0], $row[1], $row[2]);
}
}