summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-07-31 13:01:50 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-07-31 13:01:50 +0000
commit4037fa86db033e758a52642f602323cdd3e85015 (patch)
treea3bcc8bd3af5dea73c3fc8f4f2e035737412a7d3 /modules/taxonomy/taxonomy.test
parent9588a5b38b2e607c8c3253a56585eedc80481d2b (diff)
downloadbrdo-4037fa86db033e758a52642f602323cdd3e85015.tar.gz
brdo-4037fa86db033e758a52642f602323cdd3e85015.tar.bz2
#846524 by aaronbauman, mgifford: Fixed Terms cannot be manually reordered by weight.
Diffstat (limited to 'modules/taxonomy/taxonomy.test')
-rw-r--r--modules/taxonomy/taxonomy.test20
1 files changed, 8 insertions, 12 deletions
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 391dc01df..adda2fa3a 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -593,29 +593,25 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
drupal_static_reset('taxonomy_get_treeterms');
list($term1, $term2, $term3) = taxonomy_get_tree($this->vocabulary->vid);
- // Change the order to term2, term3, term1. Emulate the reordering done by
- // tabledrag.js by changing the page HTML source. Each term has three hidden
- // fields, "tid:1:0[tid]", "tid:1:0[parent]", and "tid:1:0[depth]". The
- // order of the input fields in the page is used when the form is processed.
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->machine_name);
- $reorder = array(
- 'tid:' . $term1->tid . ':0' => 'tid:' . $term2->tid . ':0',
- 'tid:' . $term2->tid . ':0' => 'tid:' . $term3->tid . ':0',
- 'tid:' . $term3->tid . ':0' => 'tid:' . $term1->tid . ':0',
- );
- $this->drupalSetContent(strtr($this->drupalGetContent(), $reorder));
-
- // Make term3 a child of term2, and update all hidden fields.
+
+ // Each term has four hidden fields, "tid:1:0[tid]", "tid:1:0[parent]",
+ // "tid:1:0[depth]", and "tid:1:0[weight]". Change the order to term2,
+ // term3, term1 by setting weight property, make term3 a child of term2 by
+ // setting the parent and depth properties, and update all hidden fields.
$edit = array(
'tid:' . $term2->tid . ':0[tid]' => $term2->tid,
'tid:' . $term2->tid . ':0[parent]' => 0,
'tid:' . $term2->tid . ':0[depth]' => 0,
+ 'tid:' . $term2->tid . ':0[weight]' => 0,
'tid:' . $term3->tid . ':0[tid]' => $term3->tid,
'tid:' . $term3->tid . ':0[parent]' => $term2->tid,
'tid:' . $term3->tid . ':0[depth]' => 1,
+ 'tid:' . $term3->tid . ':0[weight]' => 1,
'tid:' . $term1->tid . ':0[tid]' => $term1->tid,
'tid:' . $term1->tid . ':0[parent]' => 0,
'tid:' . $term1->tid . ':0[depth]' => 0,
+ 'tid:' . $term1->tid . ':0[weight]' => 2,
);
$this->drupalPost(NULL, $edit, t('Save'));