function test_batch_test_install

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/test_batch_test/test_batch_test.install \test_batch_test_install()
  2. 8.9.x core/modules/system/tests/modules/test_batch_test/test_batch_test.install \test_batch_test_install()
  3. 10 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

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.