Generated with the help of an LLM.

Problem/Motivation

Follow-ups of #2875151: [META] Implement Batch API as a service move form.inc and batch.inc code into a service. Reviewing that move as behaviour-neutral needs tests that pass before and after. These behaviours have no test:

  • hook_batch_alter() is invoked and its changes are applied.
  • The destination query argument is removed at batch start and restored at the end.
  • Redirect precedence: finished callback response, form state redirect, batch_process() $redirect argument, source URL.
  • A non-progressive batch run outside the Form API.
  • The session batches key is removed after the last batch finishes.

Steps to reproduce

Not applicable.

Proposed resolution

Add tests and test fixtures only. The tests call batch_set(), batch_process() and batch_get(), so the refactor must pass them unchanged.

  • batch_test: a state-gated hook_batch_alter() implementation, a recording callback, three test routes.
  • ProcessingTest: testBatchAlter(), testDestinationPreserved(), testRedirectPrecedence(), testSessionCleanup().
  • BatchKernelTest: testNonProgressiveOutsideForm().

Each test fails when the code it covers is temporarily broken.

Remaining tasks

  • Review.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Issue fork drupal-3636680

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

voleger created an issue. See original summary.

voleger’s picture

Assigned: Unassigned » voleger
Status: Active » Needs work

voleger’s picture

Assigned: voleger » Unassigned
Status: Needs work » Needs review
voleger’s picture