You are here

function BatchTestController::testProgrammatic in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php \Drupal\batch_test\Controller\BatchTestController::testProgrammatic()

Submits the 'Chained' form programmatically.

Programmatic form: the page submits the 'Chained' form through \Drupal::formBuilder()->submitForm().

Parameters

int $value: Some value passed to a the chained form.

Return value

array Render array containing markup.

1 string reference to 'BatchTestController::testProgrammatic'
batch_test.routing.yml in core/modules/system/tests/modules/batch_test/batch_test.routing.yml
core/modules/system/tests/modules/batch_test/batch_test.routing.yml

File

core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php, line 102
Contains \Drupal\batch_test\Controller\BatchTestController.

Class

BatchTestController
Controller routines for batch tests.

Namespace

Drupal\batch_test\Controller

Code

function testProgrammatic($value = 1) {
  $form_state = (new FormState())
    ->setValues([
    'value' => $value,
  ]);
  \Drupal::formBuilder()
    ->submitForm('Drupal\\batch_test\\Form\\BatchTestChainedForm', $form_state);
  return array(
    'success' => array(
      '#markup' => 'Got out of a programmatic batched form.',
    ),
  );
}