diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-07-07 21:06:27 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-07-07 21:06:27 -0700 |
commit | 7191d0649aefc23924a741a0d0151df7cc04ebc2 (patch) | |
tree | ba7048e8e91620e0f63c3add5477385bb3a06610 /modules/taxonomy/taxonomy.test | |
parent | 261b66d38c31a5888eee071623412cabbbeebcb5 (diff) | |
download | brdo-7191d0649aefc23924a741a0d0151df7cc04ebc2.tar.gz brdo-7191d0649aefc23924a741a0d0151df7cc04ebc2.tar.bz2 |
Issue #949616 by catch, a.mikheychik, adamdicarlo, dixon_, anavarre: Fixed Multiple parent relations confirmation form loses term description.
Diffstat (limited to 'modules/taxonomy/taxonomy.test')
-rw-r--r-- | modules/taxonomy/taxonomy.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index 97cfe448f..80ddc849c 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -761,6 +761,35 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { } /** + * Test saving a term with multiple parents through the UI. + */ + function testTermMultipleParentsInterface() { + // Add a new term to the vocabulary so that we can have multiple parents. + $parent = $this->createTerm($this->vocabulary); + + // Add a new term with multiple parents. + $edit = array( + 'name' => $this->randomName(12), + 'description[value]' => $this->randomName(100), + 'parent[]' => array(0, $parent->tid), + ); + // Save the new term. + $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/add', $edit, t('Save')); + + // Check that the term was successfully created. + $terms = taxonomy_get_term_by_name($edit['name']); + $term = reset($terms); + $this->assertNotNull($term, t('Term found in database')); + $this->assertEqual($edit['name'], $term->name, t('Term name was successfully saved.')); + $this->assertEqual($edit['description[value]'], $term->description, t('Term description was successfully saved.')); + // Check that the parent tid is still there. The other parent (<root>) is + // not added by taxonomy_get_parents(). + $parents = taxonomy_get_parents($term->tid); + $parent = reset($parents); + $this->assertEqual($edit['parent[]'][1], $parent->tid, t('Term parents were successfully saved.')); + } + + /** * Test taxonomy_get_term_by_name(). */ function testTaxonomyGetTermByName() { |