You are here

function batch_test_stack in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/batch_test/batch_test.module \batch_test_stack()
  2. 7 modules/simpletest/tests/batch_test.module \batch_test_stack()
  3. 9 core/modules/system/tests/modules/batch_test/batch_test.module \batch_test_stack()

Helper function: Stores or retrieves traced execution data.

18 calls to batch_test_stack()
PageTest::testBatchProgressPageTheme in core/modules/system/tests/src/Functional/Batch/PageTest.php
Tests that the batch API progress page uses the correct theme.
PageTest::testBatchProgressPageTitle in core/modules/system/tests/src/Functional/Batch/PageTest.php
Tests that the batch API progress page shows the title correctly.
ProcessingTest::testBatchForm in core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
Tests batches defined in a form submit handler.
ProcessingTest::testBatchFormMultipleBatches in core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
Tests batches defined in different submit handlers on the same form.
ProcessingTest::testBatchFormMultistep in core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
Tests batches defined in a multistep form.

... See full list

File

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

Code

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