summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/simpletest.module4
-rw-r--r--modules/simpletest/tests/actions.test2
-rw-r--r--modules/simpletest/tests/database_test.test2
3 files changed, 4 insertions, 4 deletions
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 55bedae2b..c3c522248 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -252,8 +252,8 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
* that ran.
*/
function simpletest_last_test_get($test_id) {
- $last_prefix = db_result(db_query_range('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = :test_id', array(':test_id' => $test_id), 0, 1));
- $last_test_class = db_result(db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = :test_id ORDER BY message_id DESC', array(':test_id' => $test_id), 0, 1));
+ $last_prefix = db_query_range('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = :test_id', 0, 1, array(':test_id' => $test_id))->fetchField();
+ $last_test_class = db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = :test_id ORDER BY message_id DESC', 0, 1, array(':test_id' => $test_id))->fetchField();
return array($last_prefix, $last_test_class);
}
diff --git a/modules/simpletest/tests/actions.test b/modules/simpletest/tests/actions.test
index 14e0dbf93..a36684047 100644
--- a/modules/simpletest/tests/actions.test
+++ b/modules/simpletest/tests/actions.test
@@ -115,7 +115,7 @@ class ActionLoopTestCase extends DrupalWebTestCase {
$result = db_query("SELECT * FROM {watchdog} WHERE type = 'actions_loop_test' OR type = 'actions' ORDER BY timestamp");
$loop_started = FALSE;
- while ($row = db_fetch_object($result)) {
+ foreach ($result as $row) {
$expected_message = array_shift($expected);
$this->assertEqual($row->message, $expected_message, t('Expected message %expected, got %message.', array('%expected' => $expected_message, '%message' => $row->message)));
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index e12431a30..1e3a52fe7 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -2448,7 +2448,7 @@ class DatabaseRangeQueryTestCase extends DrupalWebTestCase {
*/
function testRangeQuery() {
// Test if return correct number of rows.
- $range_rows = db_query_range("SELECT name FROM {system} ORDER BY name", array(), 2, 3)->fetchAll();
+ $range_rows = db_query_range("SELECT name FROM {system} ORDER BY name", 2, 3)->fetchAll();
$this->assertEqual(count($range_rows), 3, t('Range query work and return correct number of rows.'));
// Test if return target data.