summaryrefslogtreecommitdiff
path: root/scripts/run-tests.sh
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-24 20:17:07 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-24 20:17:07 +0000
commit2c11339a0ebde6797d04c62afab3779cddd15812 (patch)
tree59c3e0356e2d9282f58763f7e3f6894bf32575b4 /scripts/run-tests.sh
parent60065c683041c443cbf75072f43b500562cfa2cd (diff)
downloadbrdo-2c11339a0ebde6797d04c62afab3779cddd15812.tar.gz
brdo-2c11339a0ebde6797d04c62afab3779cddd15812.tar.bz2
- Patch #338516 by Damien Tournoud: convert run-tests.sh to the new database API.
Diffstat (limited to 'scripts/run-tests.sh')
-rwxr-xr-xscripts/run-tests.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index f6486fd69..fdd455284 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -72,8 +72,7 @@ if (!ini_get('safe_mode')) {
simpletest_script_reporter_init();
// Setup database for test results.
-db_query('INSERT INTO {simpletest_test_id} VALUES (default)');
-$test_id = db_last_insert_id('simpletest_test_id', 'test_id');
+$test_id = db_insert('simpletest_test_id')->useDefaults(array('test_id'))->execute();
// Execute tests.
simpletest_script_command($args['concurrency'], $test_id, implode(",", $test_list));
@@ -82,8 +81,9 @@ simpletest_script_command($args['concurrency'], $test_id, implode(",", $test_lis
simpletest_script_reporter_display_results();
// Cleanup our test results.
-db_query("DELETE FROM {simpletest} WHERE test_id = %d", $test_id);
-
+db_delete("simpletest")
+ ->condition('test_id', $test_id)
+ ->execute();
/**
@@ -476,9 +476,9 @@ function simpletest_script_reporter_display_results() {
'exception' => 'Exception'
);
- $results = db_query("SELECT * FROM {simpletest} WHERE test_id = %d ORDER BY test_class, message_id", $test_id);
+ $results = db_query("SELECT * FROM {simpletest} WHERE test_id = :test_id ORDER BY test_class, message_id", array(':test_id' => $test_id));
$test_class = '';
- while($result = db_fetch_object($results)) {
+ foreach ($results as $result) {
if (isset($results_map[$result->status])) {
if ($result->test_class != $test_class) {
// Display test class every time results are for new test class.