From 17f3807f2baa5b2c665413c1401e7a41515a84fe Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 5 Feb 2010 21:15:43 +0000 Subject: =?UTF-8?q?-=20Patch=20#566494=20by=20Dave=20Reid,=20chx,=20Joshua?= =?UTF-8?q?Rogers,=20David=5FRothstein,=20G=C3=A1bor=20Hojtsy,=20moshe=20w?= =?UTF-8?q?eitzman,=20Rob=20Loach,=20TheRec,=20catch:=20fixed=20cron=20doi?= =?UTF-8?q?ng=20a=20full=20bootstrap=20on=20every=20page=20request=20(incl?= =?UTF-8?q?uding=20cached=20ones).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/system/system.test | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'modules/system/system.test') 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,24 +455,9 @@ 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. * -- cgit v1.2.3