summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-09 00:58:03 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-09 00:58:03 +0000
commit6da33f2055e7bf4e069565e94a0ce0575ff16e8e (patch)
treeae65bbb2bbacf7b0117277d947b9fe75caa9c5a8 /modules/taxonomy/taxonomy.test
parent88a6e82db1657c8f39cb6338a3c511c50b1a70b4 (diff)
downloadbrdo-6da33f2055e7bf4e069565e94a0ce0575ff16e8e.tar.gz
brdo-6da33f2055e7bf4e069565e94a0ce0575ff16e8e.tar.bz2
#314147 follow-up by catch: Fixed typos with previous patch, and added tests.
Diffstat (limited to 'modules/taxonomy/taxonomy.test')
-rw-r--r--modules/taxonomy/taxonomy.test32
1 files changed, 26 insertions, 6 deletions
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 08f98dbb2..7f34de9de 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -542,8 +542,7 @@ class TaxonomyTestNodeApiTestCase extends DrupalWebTestCase {
}
/**
- * Test term edit form to ensure terms can be edited from administration page
- * and that term name and description are saved.
+ * Test term editing and creation.
*/
class TermEditTestCase extends DrupalWebTestCase {
/**
@@ -551,9 +550,8 @@ 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.'),
+ 'name' => 'Term creation and editing',
+ 'description' => t('Ensure terms can be created and saved via taxonomy administration and freetagging forms.'),
'group' => t('Taxonomy'));
}
@@ -563,11 +561,33 @@ class TermEditTestCase extends DrupalWebTestCase {
function setUp() {
parent::setUp();
// Prepare a user to do the tests.
- $web_user = $this->drupalCreateUser(array('administer taxonomy'));
+ $web_user = $this->drupalCreateUser(array('administer taxonomy', 'create article content'));
$this->drupalLogin($web_user);
}
/**
+ * Test term creation with a free-tagging vocabulary from the node form.
+ */
+ function testNodeTermCreation() {
+ $terms = array(
+ $this->randomName(),
+ $this->randomName(),
+ $this->randomName(),
+ );
+ $edit = array();
+ $edit['title'] = $this->randomName();
+ // Insert the terms in a comma separated list. Vocabulary 1 is a
+ // free-tagging field created by the default profile.
+ $edit['taxonomy[tags][1]'] = implode(', ', $terms);
+ $edit['body'] = $this->randomName();
+ $this->drupalPost('node/add/article', $edit, t('Save'));
+ $this->assertRaw(t('@type %title has been created.', array('@type' => t('Article'), '%title' => $edit['title'])), t('The node was created successfully'));
+ foreach ($terms as $term) {
+ $this->assertText($term, t('The term was saved and appears on the node page'));
+ }
+ }
+
+ /**
* Save and edit a term and assert that the name and description are correct.
*/
function testTermEdit() {