');
+ $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'));
+ }
+}
Index: modules/poll/poll.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.test,v
retrieving revision 1.25
diff -u -r1.25 poll.test
--- modules/poll/poll.test 16 Oct 2009 23:48:37 -0000 1.25
+++ modules/poll/poll.test 23 Nov 2009 05:23:17 -0000
@@ -252,6 +252,12 @@
function setUp() {
parent::setUp('poll');
+ // 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();
// Create and login user
$admin_user = $this->drupalCreateUser(array('administer blocks'));
Index: modules/path/path.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.test,v
retrieving revision 1.26
diff -u -r1.26 path.test
--- modules/path/path.test 8 Nov 2009 11:19:02 -0000 1.26
+++ modules/path/path.test 23 Nov 2009 05:23:17 -0000
@@ -17,6 +17,12 @@
function setUp() {
parent::setUp('path');
+ // 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();
// Create test user and login.
$web_user = $this->drupalCreateUser(array('create page content', 'edit own page content', 'administer url aliases', 'create url aliases'));
Index: modules/menu/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.test,v
retrieving revision 1.25
diff -u -r1.25 menu.test
--- modules/menu/menu.test 6 Nov 2009 03:17:59 -0000 1.25
+++ modules/menu/menu.test 23 Nov 2009 05:23:16 -0000
@@ -526,6 +526,12 @@
function setUp() {
parent::setUp('menu');
+ // 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();
$this->admin_user = $this->drupalCreateUser(array(
'access administration pages',