5 * Tests for taxonomy_menu.module.
7 * @TODO Add tests for other configuration options:
9 * - Display number of children.
14 * Provides common helper methods for Taxonomy menu module tests.
16 class TaxonomyMenuWebTestCase
extends TaxonomyWebTestCase
{
19 parent
::setUp('taxonomy_menu');
20 // Create and login administrative user.
21 $admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer menu', 'bypass node access'));
22 $this->drupalLogin($admin_user);
23 // Create a vocabulary and a hierarchy of taxonomy terms for it.
24 $this->vocabulary
= $this->createVocabulary();
25 $this->hierarchy
= $this->createTermsHierarchy($this->vocabulary
);
29 * Asserts that the number of menu links is equal to the number of taxonomy
30 * terms for a given menu name.
33 * The terms, which are created in this class.
35 protected
function assertEqualNumberTermsMenuLinks($terms_count, $vocabulary, $menu_name) {
36 $vid = $vocabulary->vid
;
37 // Building a query getting the number of menu links for this vocabulary.
38 $query = db_select('menu_links', 'ml')
40 ->condition('ml.module', 'taxonomy_menu')
41 ->condition('ml.menu_name', $menu_name);
42 $query->join('taxonomy_menu', 'tm', 'ml.mlid = tm.mlid');
43 $query->condition('tm.vid', $vid, '=');
44 $query_count = $query->execute()->rowCount();
45 $message = $query_count .
' menu links were found for the ' .
$terms_count .
' taxonomy terms of vocabulary ' .
$vocabulary->name .
'.';
46 $this->assertEqual($terms_count, $query_count, $message);
50 * Creates a hierarchy of taxonomy terms for the vocabulary defined in the
51 * current class. The hierarchy is as follow:
54 * -- terms[2] | depth: 1
55 * -- terms[3] | depth: 1
56 * ---- terms[4] | depth: 2
57 * -- terms[5] | depth: 1
59 * -- terms[7] | depth: 1
61 * @TODO Add multiple parents when taxonomy_menu can deal with it.
63 protected
function createTermsHierarchy($vocabulary) {
65 // Create taxonomy terms.
66 for ($i = 1; $i < 8; $i++) {
67 $terms[$i] = $this->createTerm($vocabulary);
70 $terms[2]->parent
= array($terms[1]->tid
);
71 taxonomy_term_save($terms[2]);
72 $terms[3]->parent
= array($terms[1]->tid
);
73 taxonomy_term_save($terms[3]);
74 $terms[4]->parent
= array($terms[3]->tid
);
75 taxonomy_term_save($terms[4]);
76 $terms[5]->parent
= array($terms[1]->tid
);
77 taxonomy_term_save($terms[5]);
78 $terms[7]->parent
= array($terms[6]->tid
);
79 taxonomy_term_save($terms[7]);
85 * Fetch the menu item from the database and compare it to the specified
91 * Array containing properties to verify.
93 function assertMenuLink($mlid, array $expected_item) {
94 // Retrieve menu link.
95 $item = db_query('SELECT * FROM {menu_links} WHERE mlid = :mlid', array(':mlid' => $mlid))->fetchAssoc();
96 $options = unserialize($item['options']);
97 if (!empty($options['query'])) {
98 $item['link_path'] .
= '?' .
drupal_http_build_query($options['query']);
100 if (!empty($options['fragment'])) {
101 $item['link_path'] .
= '#' .
$options['fragment'];
103 foreach ($expected_item as
$key => $value) {
104 $this->assertEqual($item[$key], $value, t('Parameter %key had expected value.', array('%key' => $key)));
110 * Tests the taxonomy vocabulary interface.
112 class TaxonomyMenuFunctionalTest
extends TaxonomyMenuWebTestCase
{
114 public static
function getInfo() {
116 'name' => 'Vocabulary interface',
117 'description' => 'Test the taxonomy menu vocabulary interface.',
118 'group' => 'Taxonomy menu',
123 parent
::setUp('taxonomy_menu');
127 * Save, edit and delete a taxonomy vocabulary using the user interface.
129 function testTaxonomyMenuVocabularyInterface() {
130 $menu_name = 'user-menu';
131 $vocab = $this->vocabulary
->machine_name
;
132 // Visit the main taxonomy administration page.
133 $this->drupalGet('admin/structure/taxonomy/' .
$vocab .
'/edit');
134 // Options for the taxonomy vocabulary edit form.
136 // Try to submit a vocabulary when menu location is a root menu item.
137 $edit['taxonomy_menu[vocab_parent]'] = $menu_name .
':0';
138 $this->drupalPost(NULL
, $edit, t('Save'));
139 $this->assertRaw(t('The Taxonomy menu has been created.'));
140 // Try to re-submit a vocabulary when an option has changed.
141 $edit['taxonomy_menu[options][hide_empty_terms]'] = TRUE
;
142 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
143 $this->assertRaw(t('The Taxonomy menu has been updated.'));
144 // Try to re-submit a vocabulary without changing any option.
145 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
146 $this->assertRaw(t('The Taxonomy menu was not updated. Nothing to update.'));
147 // Try to submit a vocabulary removing the menu location.
148 $edit['taxonomy_menu[vocab_parent]'] = '0';
149 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
150 $this->assertRaw(t('The Taxonomy menu has been removed.'));
154 * Re-order terms on the terms' overview page.
156 function testTaxonomyMenuTermsOverviewInterface() {
157 $term7 = $this->hierarchy
[7]; // last term of our hierarchy.
158 // Submit the main taxonomy administration page.
160 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
161 'taxonomy_menu[sync]' => TRUE
,
163 $this->drupalPost('admin/structure/taxonomy/' .
$this->vocabulary
->machine_name .
'/edit', $edit, t('Save'));
164 // Visit the terms overview page.
165 $this->drupalGet('admin/structure/taxonomy/' .
$this->vocabulary
->machine_name
);
166 // Take last term, place it on top and save.
168 'tid:' .
$term7->tid .
':0[tid]' => $term7->tid
,
169 'tid:' .
$term7->tid .
':0[parent]' => 0,
170 'tid:' .
$term7->tid .
':0[depth]' => 0,
171 'tid:' .
$term7->tid .
':0[weight]' => -5,
173 $this->drupalPost(NULL
, $edit, t('Save'));
174 $this->assertRaw(t('The Taxonomy menu has been updated.'));
175 // Test "Reset to alphabetical".
176 $this->drupalPost('admin/structure/taxonomy/' .
$this->vocabulary
->machine_name
, array(), t('Reset to alphabetical'));
177 $this->drupalPost(NULL
, array(), t('Reset to alphabetical'));
178 $this->assertRaw(t('The Taxonomy menu has been updated.'));
182 * Save, edit and delete a term using the user interface.
184 function testTaxonomyMenuTermInterface() {
185 $menu_name = 'main-menu';
186 $vocab_name = $this->vocabulary
->machine_name
;
188 $edit['taxonomy_menu[vocab_parent]'] = $menu_name .
':0';
189 $this->drupalPost('admin/structure/taxonomy/' .
$vocab_name .
'/edit', $edit, t('Save'));
190 // Create a new term from the interface.
193 'name' => $this->randomName(12),
194 'description[value]' => $this->randomName(100),
196 $this->drupalPost('admin/structure/taxonomy/' .
$vocab_name .
'/add', $edit, t('Save'));
197 $terms = taxonomy_get_term_by_name($edit['name']);
198 $term = reset($terms);
199 $options = array('%term' => $edit['name'], '%menu_name' => $menu_name);
200 $this->assertRaw(t('Added term %term to taxonomy menu %menu_name.', $options));
201 // Update an existing term from the interface.
203 'name' => $this->randomName(12),
204 'description[value]' => $this->randomName(100),
206 $this->drupalPost('taxonomy/term/' .
$term->tid .
'/edit', $edit, t('Save'));
207 $options = array('%term' => $edit['name'], '%menu_name' => $menu_name);
208 $this->assertRaw(t('Updated term %term in taxonomy menu %menu_name.', $options));
209 // Delete an existing term from the interface.
210 $this->drupalPost('taxonomy/term/' .
$term->tid .
'/edit', $edit, t('Delete'));
211 $this->drupalPost(NULL
, NULL
, t('Delete')); // Confirm deletion.
212 $options = array('%term' => $edit['name'], '%menu_name' => $menu_name);
213 $this->assertRaw(t('Deleted term %term from taxonomy menu %menu_name.', $options));
219 * Tests for taxonomy vocabulary functions.
221 class TaxonomyMenuUnitTest
extends TaxonomyMenuWebTestCase
{
223 public static
function getInfo() {
225 'name' => 'CRUD functions',
226 'description' => 'Test CRUD functions',
227 'group' => 'Taxonomy menu',
232 parent
::setUp('taxonomy_menu');
236 * Tests CRUD functions.
238 function testTaxonomyMenuCRUD() {
239 $menu_name = 'main-menu';
240 $vocabulary = $this->vocabulary
;
241 $terms = $this->hierarchy
;
242 $hierarchy_term = $this->hierarchy
[3]; // Arbitrary term for hierarchy.
243 $vid = $this->vocabulary
->vid
;
245 // Ensure that the taxonomy vocabulary form is successfully submitted.
246 $edit['taxonomy_menu[vocab_parent]'] = $menu_name .
':0';
247 $vocab = $this->vocabulary
->machine_name
;
248 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
249 $this->assertResponse(200);
251 // Ensure that the same number of menu links are created from the taxonomy
252 // terms of the vocabulary.
253 $this->assertEqualNumberTermsMenuLinks(count($terms), $vocabulary, $menu_name);
255 // Ensure that the menu link is updated when the taxonomy term is updated.
256 $new_name = $this->randomName();
257 $hierarchy_term->name
= $new_name;
258 taxonomy_term_save($hierarchy_term);
259 $this->drupalGet('admin/structure/menu/manage/' .
$menu_name);
260 $this->assertLink($new_name);
262 // Ensure that the menu link is deleted when the taxonomy term is deleted.
263 // Hierarchy term [3] has 1 children, if we delete it, 2 taxonomy terms
264 // should be deleted.
265 $orig_mlid = _taxonomy_menu_get_mlid($hierarchy_term->tid
, $vid);
266 taxonomy_term_delete($hierarchy_term->tid
);
267 $this->assertEqualNumberTermsMenuLinks(count($terms) - 2, $vocabulary, $menu_name);
269 $menu_link = menu_link_load($orig_mlid);
270 $message = 'The menu link ' .
$orig_mlid .
' associated to the term ' .
$hierarchy_term->tid .
' could not be found.';
271 $this->assertFalse($menu_link, $message);
273 $mlid = _taxonomy_menu_get_mlid($hierarchy_term->tid
, $vid);
274 $message = 'The ( mlid = ' .
$orig_mlid .
' / tid = ' .
$hierarchy_term->tid .
') association could not be found in {taxonomy_menu} table.';
275 $this->assertFalse($mlid, $message);
277 // Ensure that all menu links and all associations in {taxonomy_menu} table
278 // are deleted when a vocabulary is deleted.
279 $mlids = _taxonomy_menu_get_menu_items($vid);
280 taxonomy_vocabulary_delete($vid);
281 $this->assertEqualNumberTermsMenuLinks(0, $vocabulary, $menu_name);
285 * Tests the hierarchy of menu links in a menu.
287 function testTaxonomyMenuTermsHierarchy() {
288 $vocab_machine_name = $this->vocabulary
->machine_name
;
289 $vid = $this->vocabulary
->vid
;
293 $edit['taxonomy_menu[vocab_parent]'] = 'main-menu:0';
294 $this->drupalPost('admin/structure/taxonomy/' .
$vocab_machine_name .
'/edit', $edit, t('Save'));
295 $this->assertResponse(200);
297 // Given a taxonomy term, which id is tid:
300 // Do the following verification for each term in the hierarchy; the ending
301 // plid determined by the methods below should be equal.
302 // - method1: tid --> mlid --> plid
303 // - method2: tid --> ptid --> plid
304 foreach ($this->hierarchy as
$term) {
305 // 1. Get plid by getting the associated mlid for the term tid.
306 $mlid = _taxonomy_menu_get_mlid($term->tid
, $vid);
308 $menu_link = menu_link_load($mlid);
309 $plid_from_mlid = $menu_link['plid'];
310 // 2. Get plid by getting the associated mlid for the parent term ptid.
311 // We don't handle multiple parents, break after first one.
312 $parents = taxonomy_get_parents($term->tid
);
313 if (!empty($parents)) {
314 foreach ($parents as
$ptid => $parent) {
315 $plid_from_ptid = _taxonomy_menu_get_mlid($ptid, $vid);
316 // Assert that both plid found by the two different methods are equal.
317 $message = 'Parent mlids from taxonomy term ' .
$term->tid .
' are a match.';
318 $this->assertEqual($plid_from_mlid, $plid_from_ptid, $message);
323 // Current term has no parent term. This means that the name of the
324 // vocabulary should be associated to the 'navigation' root.
325 // Menu link of the current term as defined by taxonomy menu table.
326 $this->assertEqual($menu_link['plid'], 0);
330 $this->fail("mlid for taxonomy term " .
$term->tid .
" could not be found.");
336 * Tests creation of menu links in a custom menu.
338 function testTaxonomyMenuCustomMenu() {
339 $vocabulary = $this->vocabulary
;
340 $terms = $this->hierarchy
;
341 $custom_menu_name = $this->randomName(16);
342 $menu_machine_name = drupal_substr(hash('sha256', $custom_menu_name), 0, MENU_MAX_MENU_NAME_LENGTH_UI
);
344 // Submit the menu creation form.
345 $menu_edit = array();
346 $menu_edit['title'] = $custom_menu_name;
347 $menu_edit['menu_name'] = $menu_machine_name;
348 $this->drupalPost('admin/structure/menu/add', $menu_edit, 'Save');
349 $this->assertResponse(200);
351 // Submit the vocabulary edit form.
352 $vocab_edit = array();
353 $vocab_edit['taxonomy_menu[vocab_parent]'] = 'menu-' .
$menu_machine_name .
':0';
354 $this->drupalPost('admin/structure/taxonomy/' .
$vocabulary->machine_name .
'/edit', $vocab_edit, 'Save');
355 $this->assertResponse(200);
357 // Check that the menu links were created in the custom menu.
358 $this->assertEqualNumberTermsMenuLinks(count($terms), $vocabulary, 'menu-' .
$menu_machine_name);
364 * Tests Taxonomy menu configuration options.
366 class TaxonomyMenuConfigurationTest
extends TaxonomyMenuWebTestCase
{
368 public static
function getInfo() {
370 'name' => 'Configuration options',
371 'description' => 'Test configuration options.',
372 'group' => 'Taxonomy menu',
377 parent
::setUp('taxonomy_menu');
381 * Tests Taxonommy Menu sync option.
383 function testTaxonomyMenuSyncOption() {
384 $vocab = $this->vocabulary
->machine_name
;
386 // Set settings (no sync on main-menu).
388 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
389 'taxonomy_menu[sync]' => FALSE
,
391 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
392 $this->assertResponse(200);
395 $new_name = $this->randomName(12);
396 $test_term = $this->hierarchy
[3]; // Arbitrary term from hierarchy
397 $test_term->name
= $new_name;
399 // Save new term's name with sync option off.
400 taxonomy_term_save($test_term);
401 $mlid = _taxonomy_menu_get_mlid($test_term->tid
, $this->vocabulary
->vid
);
402 $menu_link = menu_link_load($mlid);
403 $this->assertNotEqual($new_name, $menu_link['link_title']);
405 // Switch to sync option on and save.
406 $edit['taxonomy_menu[sync]'] = TRUE
;
407 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
408 $this->assertResponse(200);
409 $mlid = _taxonomy_menu_get_mlid($test_term->tid
, $this->vocabulary
->vid
);
410 $menu_link = menu_link_load($mlid);
411 $this->assertEqual($new_name, $menu_link['link_title']);
415 * Tests Taxonommy Menu expand option.
417 function testTaxonomyMenuExpandedOption() {
418 $vocab = $this->vocabulary
->machine_name
;
420 // Set settings on expanded.
422 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
423 'taxonomy_menu[options][expanded]' => TRUE
,
425 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
427 // Build the base query.
428 $base_query = db_select('menu_links', 'ml');
429 $base_query->join('taxonomy_menu', 'tm', 'ml.mlid = tm.mlid');
430 $base_query->fields('ml')
431 ->condition('tm.vid', $this->vocabulary
->vid
)
432 ->condition('ml.module', 'taxonomy_menu');
434 // Assert that menu links are expanded.
435 $query = $base_query->condition('ml.expanded', TRUE
);
436 $row_count = $query->execute()->rowCount();
437 $this->assertEqual(count($this->hierarchy
), $row_count);
439 // Set settings on not expanded.
441 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
442 'taxonomy_menu[options][expanded]' => FALSE
,
444 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
446 // Assert that menu links are not expanded anymore.
447 $query = $base_query->condition('ml.expanded', FALSE
);
448 $row_count = $query->execute()->rowCount();
449 $this->assertEqual(0, $row_count);
453 * Tests Taxonommy Menu "Term description" option.
455 function testTaxonomyMenuTermDescriptionOption() {
456 $vocab = $this->vocabulary
->machine_name
;
458 // Set settings on expanded.
460 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
461 'taxonomy_menu[options][term_item_description]' => FALSE
,
462 'taxonomy_menu[options][display_title_attr]' => TRUE
,
464 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
466 // Assert that menu links does not have the term description.
467 $term = $this->hierarchy
[3];
468 $mlid = _taxonomy_menu_get_mlid($term->tid
, $this->vocabulary
->vid
);
469 $menu_link = menu_link_load($mlid);
470 $menu_link_title = $menu_link['options']['attributes']['title'];
471 $this->assertEqual($menu_link_title, '');
473 // Assert that menu links does have the term description, when the option is
476 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
477 'taxonomy_menu[options][term_item_description]' => TRUE
,
478 'taxonomy_menu[options][display_title_attr]' => TRUE
,
480 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
481 $menu_link = menu_link_load($mlid);
482 $menu_link_title = $menu_link['options']['attributes']['title'];
483 $this->assertEqual($menu_link_title, $term->description
);
485 // Assert that menu links does not have the term description, when the option
486 // for displaying a description is on but the display title option is off.
488 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
489 'taxonomy_menu[options][term_item_description]' => TRUE
,
490 'taxonomy_menu[options][display_title_attr]' => FALSE
,
492 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
493 $menu_link = menu_link_load($mlid);
494 $menu_link_title = $menu_link['options']['attributes']['title'];
495 $this->assertEqual($menu_link_title, '');
499 * Tests Taxonommy Menu "Flatten" option.
501 function testTaxonomyMenuFlattenOption() {
502 $vocab = $this->vocabulary
->machine_name
;
506 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
507 'taxonomy_menu[options][flat]' => TRUE
,
509 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
511 // Assert that all of the menu links have no children with the root being
513 $query = db_select('menu_links', 'ml');
514 $query->join('taxonomy_menu', 'tm', 'ml.mlid = tm.mlid');
515 $query->fields('ml');
517 ->condition('tm.vid', $this->vocabulary
->vid
)
518 ->condition('ml.menu_name', 'main-menu')
519 ->condition('ml.module', 'taxonomy_menu')
520 ->condition('ml.has_children', 0)
521 ->condition('ml.plid', 0);
522 $row_count = $query->execute()->rowCount();
523 $this->assertEqual(count($this->hierarchy
), $row_count);
525 // Assert that all of the menu links have no children with the root being
528 'menu_name' => 'main-menu',
530 'link_title' => 'test',
531 'link_path' => '<front>',
532 'module' => 'taxonomy_menu',
534 $mlid = menu_link_save($item);
535 menu_cache_clear('main-menu');
538 'taxonomy_menu[vocab_parent]' => 'main-menu:' .
$mlid,
539 'taxonomy_menu[options][flat]' => TRUE
,
541 $this->drupalPost('admin/structure/taxonomy/' .
$vocab .
'/edit', $edit, t('Save'));
543 $query = db_select('menu_links', 'ml');
544 $query->join('taxonomy_menu', 'tm', 'ml.mlid = tm.mlid');
545 $query->fields('ml');
547 ->condition('tm.vid', $this->vocabulary
->vid
)
548 ->condition('ml.menu_name', 'main-menu')
549 ->condition('ml.module', 'taxonomy_menu')
550 ->condition('ml.has_children', 0)
551 ->condition('ml.plid', $mlid);
552 $row_count = $query->execute()->rowCount();
553 $this->assertEqual(count($this->hierarchy
), $row_count);
557 * Tests Taxonommy Menu "Hide Empty terms" option.
559 function testTaxonomyMenuHideEmptyTerms() {
560 $voc_machine_name = $this->vocabulary
->machine_name
;
562 // Create several nodes and attach them to different terms of our hierarchy
563 // in order to match the following scheme.
564 /** terms[1] | depth: 0 | 0 node -> displayed
565 * -- terms[2] | depth: 1 | 0 node -> hidden
566 * -- terms[3] | depth: 1 | 2 nodes -> displayed
567 * ---- terms[4] | depth: 2 | 0 node -> hidden
568 * -- terms[5] | depth: 1 | 1 node -> displayed
569 * terms[6] | depth: 0 | 0 node -> hidden
570 * -- terms[7] | depth: 1 | 0 node -> hidden */
572 // Add a taxonomy reference to the "Article" content type.
574 'field_name' => 'taxonomy_' .
$voc_machine_name,
575 'type' => 'taxonomy_term_reference',
576 'cardinality' => FIELD_CARDINALITY_UNLIMITED
,
578 'allowed_values' => array(
580 'vocabulary' => $voc_machine_name,
586 field_create_field($field);
587 $this->instance
= array(
588 'field_name' => 'taxonomy_' .
$voc_machine_name,
589 'bundle' => 'article',
590 'entity_type' => 'node',
592 'type' => 'options_select',
596 'type' => 'taxonomy_term_reference_link',
600 field_create_instance($this->instance
);
602 // Create 3 articles respecting the previous scheme.
603 $terms_index = array(3, 3, 5);
604 foreach ($terms_index as
$index) {
606 $langcode = LANGUAGE_NONE
;
607 $edit["title"] = $this->randomName();
608 $edit["body[$langcode][0][value]"] = $this->randomName();
609 $edit[$this->instance
['field_name'] .
'[' .
$langcode .
'][]'] = $this->hierarchy
[$index]->tid
;
610 $this->drupalPost('node/add/article', $edit, t('Save'));
613 // Set settings and save.
615 'taxonomy_menu[vocab_parent]' => 'main-menu:0',
616 'taxonomy_menu[options][hide_empty_terms]' => TRUE
,
618 $this->drupalPost('admin/structure/taxonomy/' .
$voc_machine_name .
'/edit', $edit, t('Save'));
620 // Assert that the hidden property of the taxonomy menu's menu links are
621 // set according to the scheme.
622 $visible_terms_index = array(1, 3, 5);
623 $hidden_item = array('hidden' => TRUE
);
624 $visible_item = array('hidden' => FALSE
);
626 foreach ($this->hierarchy as
$term) {
627 $mlid = _taxonomy_menu_get_mlid($term->tid
, $this->vocabulary
->vid
);
629 if (in_array($index, $visible_terms_index)) {
630 $this->assertMenuLink($mlid, $visible_item);
633 $this->assertMenuLink($mlid, $hidden_item);
637 $this->fail('No mlid could be found for the term ' .
$term->tid
);