You are here

function TaxonomyMenuOperations::testTaxMenuCreate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 modules/taxonomy_menu/src/Tests/TaxonomyMenuOperations.php \Drupal\taxonomy_menu\Tests\TaxonomyMenuOperations::testTaxMenuCreate()

Test creation of taxonomy menu functions.

File

modules/taxonomy_menu/src/Tests/TaxonomyMenuOperations.php, line 93
Definition of Drupal\taxonomy_menu\Tests\KeyService.

Class

TaxonomyMenuOperations
Tests the operations of Taxonomy Menu.

Namespace

Drupal\taxonomy_menu\Tests

Code

function testTaxMenuCreate() {

  // Check menu for taxonomy-based menu items keyed 1, 2, and 3.
  $this
    ->drupalGet('admin/structure/menu/manage/test-menu');
  $this
    ->assertFieldByName('links[menu_plugin_id:taxonomy_menu.menu_link:taxonomy_menu.menu_link.test_tax_menu.1][enabled]', NULL, 'I should expect to see enabled field for taxonomy term 1');
  $this
    ->assertFieldByName('links[menu_plugin_id:taxonomy_menu.menu_link:taxonomy_menu.menu_link.test_tax_menu.2][enabled]', NULL, 'I should expect to see enabled field for taxonomy term 2');
  $this
    ->assertFieldByName('links[menu_plugin_id:taxonomy_menu.menu_link:taxonomy_menu.menu_link.test_tax_menu.3][enabled]', NULL, 'I should expect to see enabled field for taxonomy term 3');

  // Check 2 is a parent of 1.
  $this
    ->assertFieldByName('links[menu_plugin_id:taxonomy_menu.menu_link:taxonomy_menu.menu_link.test_tax_menu.2][parent]', 'taxonomy_menu.menu_link:taxonomy_menu.menu_link.test_tax_menu.1', 'I should expect to see taxonomy term 2 have a parent of taxonomy term 1');
}