/**
* Tests batches triggered outside of form submission.
*/ publicfunctiontestBatchNoForm(){ // Displaying the page triggers batch 1.
$this->drupalGet('batch-test/no-form'); $this->assertBatchMessages($this->_resultMessages('batch_1')); $this->assertEquals($this->_resultStack('batch_1'), batch_test_stack(), 'Execution order was correct.'); $this->assertSession()->pageTextContains('Redirection successful.'); }
/**
* Tests batches that redirect in the batch finished callback.
*/ publicfunctiontestBatchRedirectFinishedCallback(){ // Displaying the page triggers batch 1.
$this->drupalGet('batch-test/finish-redirect'); $this->assertBatchMessages($this->_resultMessages('batch_1')); $this->assertEquals($this->_resultStack('batch_1'), batch_test_stack(), 'Execution order was correct.');