diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php index 3840c65..58aed6d 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php @@ -50,10 +50,10 @@ function createVocabulary() { /** * Returns a new term with random properties in vocabulary $vid. */ - function createTerm($vocabulary) { + function createTerm($vocabulary, $values=array()) { $filter_formats = filter_formats(); $format = array_pop($filter_formats); - $term = entity_create('taxonomy_term', array( + $term = entity_create('taxonomy_term', $values + array( 'name' => $this->randomName(), 'description' => array( 'value' => $this->randomName(), diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php index 1806d36..cc452ff 100644 --- a/core/modules/taxonomy/src/Tests/TermTest.php +++ b/core/modules/taxonomy/src/Tests/TermTest.php @@ -109,17 +109,19 @@ function testTaxonomyTermChildTerms() { // Create 40 terms. Terms 1-12 get parent of $term1. All others are // individual terms. for ($x = 1; $x <= 40; $x++) { - $term = $this->createTerm($this->vocabulary); - $edit = array(); // Set terms in order so we know which terms will be on which pages. $edit['weight'] = $x; // Set terms 1-20 to be children of first term created. if ($x <= 12) { - $edit['parent[]'] = $term1->id(); + $edit['parent'] = $term1->id(); + } + else + { + $edit['parent'] = 0; } - $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', $edit, t('Save')); + $term = $this->createTerm($this->vocabulary,$edit); $children = taxonomy_term_load_children($term1->id()); $parents = taxonomy_term_load_parents($term->id()); $terms_array[$x] = taxonomy_term_load($term->id());