You are here

function MenuAttributesTestBase::assertMenuAttributes in Menu Attributes 8

Parameters

$form_parent:

string $action:

File

src/Tests/MenuAttributesTestBase.php, line 128

Class

MenuAttributesTestBase
Helper test class with some added functions for testing.

Namespace

Drupal\menu_attributes\Tests

Code

function assertMenuAttributes($form_parent, $action = 'new') {
  if ($action == 'new') {
    foreach ($this->menu_attributes_new as $attribute => $value) {
      $this
        ->assertFieldByName($form_parent . '[' . $attribute . ']', $value, t("'{$attribute}' attribute correct in edit form."));
    }
  }
  else {
    foreach ($this->menu_attributes_edit as $attribute => $value) {
      $this
        ->assertFieldByName($form_parent . '[' . $attribute . ']', $value, t("New '{$attribute}' attribute correct in edit form."));
    }
  }
}