');
+ $results = $this->elements->xpath('//div[@id="block-node-recent"]');
+ $div = $results[0];
+ if (!count($this->nodes)) {
+ $this->assertFalse($div, t('Block does not appear when no nodes exist.'));
+ return;
+ }
+ $this->assertTrue($div, t('Block appears when several nodes exist.'));
+ $title = $div->h2;
+ $this->assertEqual($title, t('Recent content'), t('Title of the block matches correctly.'));
+ // Under the block div, we have the , and then another
+ // div surrounding the themed item list before we get to the ul.
+ $ul = $div->div->div->ul;
+ $this->assertEqual(count($ul->li), min(count($this->nodes) - 1, $count), t('The correct number of nodes are shown.'));
+ for ($i = 0; $i < $count; $i++) {
+ if (isset($this->nodes[$i])) {
+ $list_item = $ul->li[$i];
+ $link = $list_item->a;
+ $this->assertEqual($link, $this->nodes[$i]->title[FIELD_LANGUAGE_NONE][0]['value'], t('The correct node title is shown.'));
+ }
+ }
+ $this->assertNoText($this->nodes[-1]->title[FIELD_LANGUAGE_NONE][0]['value'], t('Unpublished nodes not shown'));
+ }
+}
=== modified file 'modules/search/search.test'
--- modules/search/search.test 2009-10-19 23:28:40 +0000
+++ modules/search/search.test 2009-11-21 15:47:17 +0000
@@ -262,6 +262,13 @@ class SearchAdvancedSearchForm extends D
// and searching has to happen in the same request, so running the shutdown
// function manually is needed to finish the indexing process.
search_update_totals();
+
+ // Remove the "recent content" block because it will mess up our assertions
+ // later if enabled.
+ db_delete('block')
+ ->condition('module', 'node')
+ ->condition('delta', 'recent')
+ ->execute();
}
/**
=== modified file 'modules/system/system.module'
--- modules/system/system.module 2009-11-19 01:24:44 +0000
+++ modules/system/system.module 2009-11-21 09:42:58 +0000
@@ -3076,8 +3076,11 @@ function system_page_build(&$page) {
* @see system_run_cron_image_access()
*/
function system_run_cron_image() {
- drupal_page_is_cacheable(FALSE);
-
+ $cron_last = variable_get('cron_last', NULL);
+ $cron_threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD);
+ // Let's set Expires to the next run.
+ drupal_add_http_header('Expires', gmdate(DATE_RFC1123, $cron_last + $cron_threshold));
+
// Output a transparent 1x1 image to the browser; required for clients not
// supporting JavaScript.
drupal_add_http_header('Content-Type', 'image/gif');
@@ -3098,8 +3101,6 @@ function system_run_cron_image() {
}
else {
// Run cron automatically if it has never run or threshold was crossed.
- $cron_last = variable_get('cron_last', NULL);
- $cron_threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD);
if (!isset($cron_last) || (REQUEST_TIME - $cron_last > $cron_threshold)) {
// Lock cron threshold semaphore.
variable_set('cron_threshold_semaphore', REQUEST_TIME);
=== modified file 'modules/tracker/tracker.test'
--- modules/tracker/tracker.test 2009-11-14 07:58:49 +0000
+++ modules/tracker/tracker.test 2009-11-21 15:47:17 +0000
@@ -21,6 +21,13 @@ class TrackerTest extends DrupalWebTestC
$this->user = $this->drupalCreateUser($permissions);
$this->other_user = $this->drupalCreateUser($permissions);
+ // Remove the "recent content" block because it will mess up our assertions
+ // later on if enabled.
+ db_delete('block')
+ ->condition('module', 'node')
+ ->condition('delta', 'recent')
+ ->execute();
+
// Make node preview optional.
variable_set('comment_preview_page', 0);
}
=== modified file 'profiles/default/default.install'
--- profiles/default/default.install 2009-11-10 17:27:53 +0000
+++ profiles/default/default.install 2009-11-21 15:47:17 +0000
@@ -130,6 +130,16 @@ function default_install() {
'pages' => '',
'cache' => -1,
),
+ array(
+ 'module' => 'node',
+ 'delta' => 'recent',
+ 'theme' => 'garland',
+ 'status' => 1,
+ 'weight' => 0,
+ 'region' => 'sidebar_first',
+ 'pages' => '',
+ 'cache' => -1,
+ ),
);
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
foreach ($values as $record) {