diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-17 19:28:14 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-17 19:28:14 +0000 |
commit | ea6242d53dc0d1be887714a8740d4a9e93d574fc (patch) | |
tree | a35b1107697b7af34b5d36245a2afb1b7ee5282d /modules/node | |
parent | 1bd3670b300dc35687aa2adc7c3daebaf9e94ab4 (diff) | |
download | brdo-ea6242d53dc0d1be887714a8740d4a9e93d574fc.tar.gz brdo-ea6242d53dc0d1be887714a8740d4a9e93d574fc.tar.bz2 |
#993026 by bblake, agentrickard: Fixed Default sort on admin/content incorrect
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.test | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/node/node.test b/modules/node/node.test index dd73e2413..3e0db8615 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1409,6 +1409,20 @@ class NodeAdminTestCase extends DrupalWebTestCase { $this->drupalCreateNode(array('title' => $prefix . $this->randomName(6))); } + // Test that the default sort by node.changed DESC actually fires properly. + $nodes_query = db_select('node', 'n') + ->fields('n', array('nid')) + ->orderBy('changed', 'DESC') + ->execute() + ->fetchCol(); + + $nodes_form = array(); + $this->drupalGet('admin/content'); + foreach ($this->xpath('//table/tbody/tr/td/div/input/@value') as $input) { + $nodes_form[] = $input; + } + $this->assertEqual($nodes_query, $nodes_form, 'Nodes are sorted in the form according to the default query.'); + // Compare the rendered HTML node list to a query for the nodes ordered by // title to account for possible database-dependent sort order. $nodes_query = db_select('node', 'n') @@ -1417,6 +1431,7 @@ class NodeAdminTestCase extends DrupalWebTestCase { ->execute() ->fetchCol(); + $nodes_form = array(); $this->drupalGet('admin/content', array('query' => array('sort' => 'asc', 'order' => 'Title'))); foreach ($this->xpath('//table/tbody/tr/td/div/input/@value') as $input) { $nodes_form[] = $input; |