summaryrefslogtreecommitdiff
path: root/modules/system/system.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-02-05 21:15:43 +0000
committerDries Buytaert <dries@buytaert.net>2010-02-05 21:15:43 +0000
commit17f3807f2baa5b2c665413c1401e7a41515a84fe (patch)
treee55405b3376882b81a5433fb033c52684fcddfd0 /modules/system/system.test
parent06daeb7d505c7439fa4bf32c150561d7d1cbe8d3 (diff)
downloadbrdo-17f3807f2baa5b2c665413c1401e7a41515a84fe.tar.gz
brdo-17f3807f2baa5b2c665413c1401e7a41515a84fe.tar.bz2
- Patch #566494 by Dave Reid, chx, JoshuaRogers, David_Rothstein, Gábor Hojtsy, moshe weitzman, Rob Loach, TheRec, catch: fixed cron doing a full bootstrap on every page request (including cached ones).
Diffstat (limited to 'modules/system/system.test')
-rw-r--r--modules/system/system.test23
1 files changed, 1 insertions, 22 deletions
diff --git a/modules/system/system.test b/modules/system/system.test
index 3d186a622..0bd05a45b 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -422,7 +422,7 @@ class CronRunTestCase extends DrupalWebTestCase {
}
/**
- * Ensure that the automatic cron run callback is working.
+ * Ensure that the automatic cron run feature is working.
*
* In these tests we do not use REQUEST_TIME to track start time, because we
* need the exact time when cron is triggered.
@@ -435,19 +435,13 @@ class CronRunTestCase extends DrupalWebTestCase {
variable_set('cron_last', $cron_last);
variable_set('cron_safe_threshold', $cron_safe_threshold);
$this->drupalGet('');
- $this->assertRaw('"cronCheck":' . ($cron_last + $cron_safe_threshold));
- $this->drupalGet('system/run-cron-check');
- $this->assertExpiresHeader($cron_last + $cron_safe_threshold);
$this->assertTrue($cron_last == variable_get('cron_last', NULL), t('Cron does not run when the cron threshold is not passed.'));
// Test if cron runs when the cron threshold was passed.
$cron_last = time() - 200;
variable_set('cron_last', $cron_last);
$this->drupalGet('');
- $this->assertRaw('"cronCheck":' . ($cron_last + $cron_safe_threshold));
sleep(1);
- $this->drupalGet('system/run-cron-check');
- $this->assertExpiresHeader(variable_get('cron_last', NULL) + $cron_safe_threshold);
$this->assertTrue($cron_last < variable_get('cron_last', NULL), t('Cron runs when the cron threshold is passed.'));
// Disable the cron threshold through the interface.
@@ -461,25 +455,10 @@ class CronRunTestCase extends DrupalWebTestCase {
$cron_last = time() - 200;
variable_set('cron_last', $cron_last);
$this->drupalGet('');
- $this->assertNoRaw('cronCheck');
- $this->drupalGet('system/run-cron-check');
- $this->assertResponse(403);
$this->assertTrue($cron_last == variable_get('cron_last', NULL), t('Cron does not run when the cron threshold is disabled.'));
}
/**
- * Assert that the Expires header is a specific timestamp.
- *
- * @param $timestamp
- * The timestamp value to match against the header.
- */
- private function assertExpiresHeader($timestamp) {
- $expires = $this->drupalGetHeader('Expires');
- $expires = strtotime($expires);
- $this->assertEqual($expires, $timestamp, t('Expires header expected @expected got @actual.', array('@expected' => $timestamp, '@actual' => $expires)));
- }
-
- /**
* Ensure that temporary files are removed.
*
* Create files for all the possible combinations of age and status. We are