function BatchTestDefinitions::batch8

Batch 8: Throws an exception.

File

core/modules/system/tests/modules/batch_test/src/BatchTestDefinitions.php, line 190

Class

BatchTestDefinitions
Batch definitions for testing batches.

Namespace

Drupal\batch_test

Code

public function batch8() : array {
    $batch_test_callbacks = new BatchTestCallbacks();
    $batch_builder = (new BatchBuilder())->addOperation([
        $batch_test_callbacks,
        'callback8',
    ], [
        FALSE,
    ])
        ->addOperation([
        $batch_test_callbacks,
        'callback8',
    ], [
        TRUE,
    ]);
    return $batch_builder->toArray() + [
        'batch_test_id' => 'batch8',
    ];
}

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