You are here

function test_batch_test_install in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/test_batch_test/test_batch_test.install \test_batch_test_install()
  2. 9 core/modules/system/tests/modules/test_batch_test/test_batch_test.install \test_batch_test_install()

Implements hook_install().

File

core/modules/system/tests/modules/test_batch_test/test_batch_test.install, line 13
Install hooks for test module.

Code

function test_batch_test_install() {
  $total = 2;
  $operations = [];
  for ($i = 1; $i <= $total; $i++) {
    $operations[] = [
      '_test_batch_test_callback',
      [
        $i,
      ],
    ];
  }
  $batch = [
    'operations' => $operations,
  ];
  batch_set($batch);
  $batch =& batch_get();
  $batch['progressive'] = FALSE;
  batch_process();
}