function BatchTestController::testFinishRedirect

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php \Drupal\batch_test\Controller\BatchTestController::testFinishRedirect()
  2. 8.9.x core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php \Drupal\batch_test\Controller\BatchTestController::testFinishRedirect()
  3. 10 core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php \Drupal\batch_test\Controller\BatchTestController::testFinishRedirect()

Fires a batch process without a form submission and a finish redirect.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse|null A redirect response if the batch is progressive. No return value otherwise.

1 string reference to 'BatchTestController::testFinishRedirect'
batch_test.routing.yml in core/modules/system/tests/modules/batch_test/batch_test.routing.yml
core/modules/system/tests/modules/batch_test/batch_test.routing.yml

File

core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php, line 90

Class

BatchTestController
Controller routines for batch tests.

Namespace

Drupal\batch_test\Controller

Code

public function testFinishRedirect() {
  $batch_test_definitions = new BatchTestDefinitions();
  $batch_test_callbacks = new BatchTestCallbacks();
  $batch_test_helper = new BatchTestHelper();
  $batch_test_helper->stack(NULL, TRUE);
  $batch = $batch_test_definitions->batch1();
  $batch['finished'] = [
    $batch_test_callbacks,
    'finished1Finished',
  ];
  batch_set($batch);
  return batch_process('batch-test/redirect');
}

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