summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2012-07-08 23:58:02 -0400
committerDavid Rothstein <drothstein@gmail.com>2012-07-08 23:58:02 -0400
commite0961c9015d0446479b3c8df9c05039813fad951 (patch)
treef999cd9caac629f472113a15aa2ddf6b4848a169
parentefe6bdfd25b46a3bcb7dda5bf94937baea80ca79 (diff)
downloadbrdo-e0961c9015d0446479b3c8df9c05039813fad951.tar.gz
brdo-e0961c9015d0446479b3c8df9c05039813fad951.tar.bz2
Issue #1560028 by bleen18, sun, thehong: Remove all calls to rand() from tests.
-rw-r--r--modules/dblog/dblog.test4
-rw-r--r--modules/field/tests/field.test2
-rw-r--r--modules/simpletest/tests/actions.test2
3 files changed, 4 insertions, 4 deletions
diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test
index 2e9810b86..a91356c85 100644
--- a/modules/dblog/dblog.test
+++ b/modules/dblog/dblog.test
@@ -424,7 +424,7 @@ class DBLogTestCase extends DrupalWebTestCase {
$severity = WATCHDOG_EMERGENCY;
for ($j = 0; $j < 3; $j++) {
$types[] = $type = array(
- 'count' => mt_rand(1, 5),
+ 'count' => $j + 1,
'type' => $type_name,
'severity' => $severity++,
);
@@ -473,7 +473,7 @@ class DBLogTestCase extends DrupalWebTestCase {
$count = $this->getTypeCount($types);
$this->assertEqual(array_sum($count), $type['count'], 'Count matched');
}
-
+
// Clear all logs and make sure the confirmation message is found.
$this->drupalPost('admin/reports/dblog', array(), t('Clear log messages'));
$this->assertText(t('Database log cleared.'), t('Confirmation message found'));
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index 0f7c41740..739ddbe99 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -2806,7 +2806,7 @@ class FieldTranslationsTestCase extends FieldTestCase {
$options = array();
$entities = array();
$entity_type = 'test_entity';
- $entity_count = mt_rand(2, 5);
+ $entity_count = 5;
$available_languages = field_available_languages($this->entity_type, $this->field);
for ($id = 1; $id <= $entity_count; ++$id) {
diff --git a/modules/simpletest/tests/actions.test b/modules/simpletest/tests/actions.test
index 23587f0c5..4d58b59cc 100644
--- a/modules/simpletest/tests/actions.test
+++ b/modules/simpletest/tests/actions.test
@@ -97,7 +97,7 @@ class ActionLoopTestCase extends DrupalWebTestCase {
// recursion level should be kept low enough to prevent the xdebug
// infinite recursion protection mechanism from aborting the request.
// See http://drupal.org/node/587634.
- variable_set('actions_max_stack', mt_rand(3, 12));
+ variable_set('actions_max_stack', 7);
$this->triggerActions();
}