You are here

public function FormModeManagerBase::setUpFormMode in Form mode manager 8

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

Helper method to create all users needed for tests.

3 calls to FormModeManagerBase::setUpFormMode()
FormModeManagerBase::setUpNodeFormMode in tests/src/Functional/FormModeManagerBase.php
Helper method to create Form mode onto Node entity needed for tests.
FormModeManagerBase::setUpUserFormMode in tests/src/Functional/FormModeManagerBase.php
Helper method to create Form mode onto Node entity needed for tests.
FormModeManagerRouteTest::testAnonymousSpecificFormModeManagerRoutes in tests/src/Functional/FormModeManagerRouteTest.php
Asserts that anon had access to a specific form mode, create and edit node.

File

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

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
    ->drupalPostForm($path, $edit, t('Save'));
}