');
+ $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('Recently posted'), 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), $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, t('The correct node title is shown.'));
+ }
+ }
+ }
+}
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.15
diff -u -p -r1.15 search.test
--- modules/search/search.test 22 Jan 2009 04:49:58 -0000 1.15
+++ modules/search/search.test 7 Mar 2009 21:52:44 -0000
@@ -252,6 +252,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();
}
/**
Index: modules/tracker/tracker.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.test,v
retrieving revision 1.6
diff -u -p -r1.6 tracker.test
--- modules/tracker/tracker.test 9 Feb 2009 16:27:35 -0000 1.6
+++ modules/tracker/tracker.test 7 Mar 2009 21:52:44 -0000
@@ -20,6 +20,12 @@ class TrackerTest extends DrupalWebTestC
$permissions = array('access comments', 'post comments', 'post comments without approval');
$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();
}
/**
Index: profiles/default/default.profile
===================================================================
RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v
retrieving revision 1.37
diff -u -p -r1.37 default.profile
--- profiles/default/default.profile 3 Feb 2009 12:30:14 -0000 1.37
+++ profiles/default/default.profile 7 Mar 2009 21:52:44 -0000
@@ -91,9 +91,10 @@ function default_profile_task_list() {
*/
function default_profile_tasks(&$task, $url) {
- // Enable 3 standard blocks.
+ // Enable 4 standard blocks.
db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'login', 'garland', 1, 0, 'left', '', -1);
db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'navigation', 'garland', 1, 0, 'left', '', -1);
+ db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'node', 'recent', 'garland', 1, 0, 'left', '', -1);
db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'powered-by', 'garland', 1, 10, 'footer', '', -1);
// Insert default user-defined node types into the database. For a complete