You are here

function batch_test_stack in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/batch_test/batch_test.module \batch_test_stack()

Helper function: Stores or retrieves traced execution data.

28 calls to batch_test_stack()
BatchTestChainedForm::batchTestChainedFormSubmit1 in core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
Form submission handler #1 for batch_test_chained_form
BatchTestChainedForm::batchTestChainedFormSubmit2 in core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
Form submission handler #2 for batch_test_chained_form
BatchTestChainedForm::batchTestChainedFormSubmit3 in core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
Form submission handler #3 for batch_test_chained_form
BatchTestChainedForm::batchTestChainedFormSubmit4 in core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
Form submission handler #4 for batch_test_chained_form
BatchTestController::testFinishRedirect in core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php
Fires a batch process without a form submission and a finish redirect.

... See full list

File

core/modules/system/tests/modules/batch_test/batch_test.module, line 189
Helper module for the Batch API tests.

Code

function batch_test_stack($data = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::state()
      ->delete('batch_test.stack');
  }
  if (!isset($data)) {
    return \Drupal::state()
      ->get('batch_test.stack');
  }
  $stack = \Drupal::state()
    ->get('batch_test.stack');
  $stack[] = $data;
  \Drupal::state()
    ->set('batch_test.stack', $stack);
}