diff -u b/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php b/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php --- b/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php +++ b/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php @@ -21,7 +21,21 @@ * * @var object */ - protected $user; + protected $user_to_be_deleted; + + /** + * Administrator user. + * + * @var object + */ + protected $admin_user; + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('views'); /** * {@inheritdoc} @@ -29,16 +43,25 @@ protected function setUp() { parent::setUp(); - $this->user = $this->drupalCreateUser(); + $this->admin_user = $this->drupalCreateUser(array('administer users'));; + $this->user_to_be_deleted = $this->drupalCreateUser(); } /** * Tests for page not found error if batch ID does not exist. */ public function testBatchNotFound() { - $this->drupalLogin($this->user); + $this->drupalLogin($this->admin_user); + + // Replicate a batch process by cancelling a user. + $edit = array( + 'action' => 'user_cancel_user_action', + 'user_bulk_form[2]' => TRUE, + ); + $this->drupalPostForm('admin/people', $edit, t('Apply')); + $this->drupalPostForm(NULL, NULL, t('Cancel accounts')); - $batch_id = mt_rand(0, 1000); + $batch_id = db_next_id(); $this->drupalGet('batch', array( 'query' => array(