function BatchNotFoundTest::testBatchNotFound
Tests for page not found error if batch ID does not exist.
File
-
core/
modules/ system/ tests/ src/ Functional/ Batch/ BatchNotFoundTest.php, line 30
Class
- BatchNotFoundTest
- Tests if a page not found error is returned when a batch ID does not exist.
Namespace
Drupal\Tests\system\Functional\BatchCode
public function testBatchNotFound() : void {
$edit = [
'batch' => 'batch_0',
];
$this->drupalGet('batch-test');
$this->submitForm($edit, 'Submit');
$this->assertSession()
->statusCodeEquals(200);
$batch_id = \Drupal::service(BatchStorageInterface::class)->getId();
$this->drupalGet('batch', [
'query' => [
'op' => 'start',
'id' => $batch_id,
],
]);
$this->assertSession()
->statusCodeEquals(404);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.