You are here

public function FormModeManagerBase::setUpFormMode in Form mode manager 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/FormModeManagerBase.php \Drupal\Tests\form_mode_manager\Functional\FormModeManagerBase::setUpFormMode()

Helper method to configure form display for given form_mode.

3 calls to FormModeManagerBase::setUpFormMode()
FormModeManagerBase::setUp in tests/src/Functional/FormModeManagerBase.php
FormModeManagerRouteTest::testAnonymousSpecificFormModeManagerRoutes in tests/src/Functional/FormModeManagerRouteTest.php
Asserts that anon had access to a specific form mode, create and edit node.
FormModeManagerUiTest::setUp in tests/src/Functional/FormModeManagerUiTest.php

File

tests/src/Functional/FormModeManagerBase.php, line 167

Class

FormModeManagerBase
Provides a test case for form_mode_manager functional tests.

Namespace

Drupal\Tests\form_mode_manager\Functional

Code

public function setUpFormMode($path, $form_mode_id) {
  $this
    ->drupalGet($path);
  $this->formModeManager = $this->container
    ->get('form_mode.manager');
  $edit = [
    "display_modes_custom[{$this->formModeManager->getFormModeMachineName($form_mode_id)}]" => TRUE,
  ];
  $this
    ->submitForm($edit, t('Save'));
}