Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.3
diff -u -p -r1.3 taxonomy.test
--- modules/taxonomy/taxonomy.test	8 Sep 2008 21:37:21 -0000	1.3
+++ modules/taxonomy/taxonomy.test	9 Sep 2008 21:43:55 -0000
@@ -284,6 +284,44 @@ class TaxonomyTermMultipleTestCase exten
 
 }
 
+class TaxonomyAdminTestCase extends DrupalWebTestCase {
+  /**
+   * Implementation of getInfo().
+   */
+  function getInfo() {
+    return array(
+      'name' => t('Administration interface'),
+      'description' => t('Test the vocabulary administration interface.'),
+      'group' => t('Taxonomy'),
+    );
+  }
+
+  /**
+   * Implementation of setUp().
+   */
+  function setUp() {
+    parent::setUp();
+    $this->taxonomy_admin = $this->drupalCreateUser(array('administer taxonomy'));
+  }
+
+  /**
+   * Visit the various admin pages for the default 'Tags' vocabulary.
+   */
+  function testTaxonomyAdminPages() {
+    $this->drupalLogin($this->taxonomy_admin);
+    $this->drupalGet('admin/content/taxonomy');
+    $this->assertResponse('200');
+    $this->assertText(t('Article'), t('Article vocabulary found.'));
+    $this->clickLink(t('edit vocabulary'));
+    $this->assertResponse('200');
+    $this->drupalGet('admin/content/taxonomy');
+    $this->clickLink(t('list terms'));
+    $this->assertResponse('200');
+    $this->clickLink(t('Add term'));
+    $this->assertResponse('200');
+  }
+}
+
 class TaxonomyTestNodeApiTestCase extends DrupalWebTestCase {
   /**
    * Implementation of getInfo().
@@ -292,7 +330,7 @@ class TaxonomyTestNodeApiTestCase extend
     return array(
       'name' => t('Taxonomy nodeapi'),
       'description' => t('Save & edit a node and assert that taxonomy terms are saved/loaded properly.'),
-      'group' => t('Taxonomy')
+      'group' => t('Taxonomy'),
     );
   }
 
@@ -420,3 +458,58 @@ class TaxonomyTestNodeApiTestCase extend
     taxonomy_save_vocabulary($edit);
   }
 }
+
+
+class TermEditTestCase extends DrupalWebTestCase {
+  function getInfo() {
+    return array(
+      'name'  => 'Term edit test',
+      'description'  => t('Ensure terms can be edited from administration page
+       and that term name and description are saved.  (Advanced options are not
+       tested.)'),
+      'group' => t('Taxonomy'));
+  }
+  function testTermEdit() {
+
+    /* Prepare settings */
+    // @TODO change or remove:  variable_set('node_options_page', array('status', 'promote'));
+    /* Prepare a user to do the stuff */
+    $web_user = $this->drupalCreateUser(array('administer taxonomy'));
+    $this->drupalLogin($web_user);
+    $edit = array(
+      'name' => '!SimpleTest! test name'. $this->randomName(12),
+      'description' => '!SimpleTest! test description'. $this->randomName(100),
+    );
+
+    // Create the term to edit (adding to the default 'Tags' vocabulary)
+    $this->drupalPost('admin/content/taxonomy/1/add/term', $edit, t('Save'));
+
+    $term = taxonomy_get_term_by_name($edit['name']);
+    $this->assertNotNull($term, t('Term found in database'));
+
+    // Submitting a term takes us to the add page; we need the List page
+    $this->clickLink(t('List'));
+
+    // Test edit link as accessed from Taxonomy administration pages
+    // because Simpletest creates its own database when running tests
+    // we know the first edit link found on the listing page is to our term
+    $this->clickLink(t('edit'));
+
+    $this->assertText($edit['name'], t('The randomly generated term name is present.'));
+    $this->assertText($edit['description'], t('The randomly generated term description is present.'));
+
+    $edit = array(
+      'name' => '!SimpleTest! test name'. $this->randomName(14),
+      'description' => '!SimpleTest! test description'. $this->randomName(102),
+    );
+
+    // edit the term
+    $this->drupalPost('admin/content/taxonomy/edit/term/'. $term[0]->tid, $edit, t('Save'));
+
+    // view the term and check that it is correct
+    $this->drupalGet('taxonomy/term/1');
+    $this->assertText($edit['name'], t('The randomly generated term name is present.'));
+    $this->assertText($edit['description'], t('The randomly generated term description is present.'));
+  }
+}
+
