diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-07 17:31:39 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-07 17:31:39 +0000 |
commit | 800cdcc840ea138ca9c207cb43dcb6300995e4b3 (patch) | |
tree | e1081a241483a0d5f8c6a9645759b50e54f711e6 /modules/node/node.test | |
parent | 07510f71e12a6a057989ffb86cfacc57134a406e (diff) | |
download | brdo-800cdcc840ea138ca9c207cb43dcb6300995e4b3.tar.gz brdo-800cdcc840ea138ca9c207cb43dcb6300995e4b3.tar.bz2 |
#700380 by mitchmac, Dave Reid, mfb, Ryan Palmer, justinrandell: Fix sorting in tableselect if #weight is not set.
Diffstat (limited to 'modules/node/node.test')
-rw-r--r-- | modules/node/node.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/node/node.test b/modules/node/node.test index 59b12f008..66d6bf757 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1279,6 +1279,30 @@ class NodeAdminTestCase extends DrupalWebTestCase { } /** + * Tests that the table sorting works on the content admin pages. + */ + function testContentAdminSort() { + $this->drupalLogin($this->admin_user); + foreach (array('dd', 'aa', 'DD', 'bb', 'cc', 'CC', 'AA', 'BB') as $prefix) { + $this->drupalCreateNode(array('title' => $prefix . $this->randomName(6))); + } + + // 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') + ->fields('n', array('nid')) + ->orderBy('title') + ->execute() + ->fetchCol(); + + $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; + } + $this->assertEqual($nodes_query, $nodes_form, 'Nodes are sorted in the form the same as they are in the query.'); + } + + /** * Tests content overview with different user permissions. * * Taxonomy filters are tested separately. |