You are here

function TaxonomyMenuOperations::testTaxTermCreate 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::testTaxTermCreate()

Test creation of taxonomy term.

File

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

Class

TaxonomyMenuOperations
Tests the operations of Taxonomy Menu.

Namespace

Drupal\taxonomy_menu\Tests

Code

function testTaxTermCreate() {

  // Create a new term.
  $this
    ->drupalGet('admin/structure/taxonomy/manage/test_tax_vocab/add');
  $edit = [
    'name[0][value]' => 'test term 3',
  ];
  $this
    ->drupalPostForm(NULL, $edit, t('Save'));
  $this
    ->drupalGet('admin/structure/menu/manage/test-menu');

  // Check for it within the menu.
  $this
    ->assertFieldByName('links[menu_plugin_id:taxonomy_menu.menu_link:taxonomy_menu.menu_link.test_tax_menu.4][enabled]', NULL, 'I should expect to see enabled field for taxonomy term 4');
}