diff --git a/core/tests/Drupal/Tests/Core/Batch/BatchProcessorTest.php b/core/tests/Drupal/Tests/Core/Batch/BatchProcessorTest.php index 45c7033..3dbcd64 100644 --- a/core/tests/Drupal/Tests/Core/Batch/BatchProcessorTest.php +++ b/core/tests/Drupal/Tests/Core/Batch/BatchProcessorTest.php @@ -7,11 +7,68 @@ namespace Drupal\Tests\Core\Batch; +use Drupal\Core\Batch\BatchProcessor; +use Drupal\Core\Batch\BatchQueueHandlerInterface; +use Drupal\Core\Batch\BatchStorageInterface; +use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Form\FormSubmitterInterface; use Drupal\Tests\UnitTestCase; +use Symfony\Component\HttpFoundation\RequestStack; /** * @coversDefaultClass \Drupal\Core\Batch\BatchProcessor + * @group Batch */ class BatchProcessorTest extends UnitTestCase { + /** + * @var \Symfony\Component\HttpFoundation\RequestStack + */ + protected $requestStack; + + /** + * The batch queue. + * + * @var \Drupal\Core\Batch\BatchQueueHandlerInterface + */ + protected $batchQueue; + + /** + * The date formatter. + * + * @var \Drupal\Core\Datetime\DateFormatter + */ + protected $dateFormatter; + + /** + * The form submitter. + * + * @var \Drupal\Core\Form\FormSubmitterInterface + */ + protected $formSubmitter; + + /** + * The batch storage. + * + * @var \Drupal\Core\Batch\BatchStorageInterface + */ + protected $batchStorage; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + + $this->batchQueue = $this->prophesize(BatchQueueHandlerInterface::CLASS); + $this->dateFormatter = $this->prophesize(DateFormatter::CLASS); + $this->formSubmitter = $this->prophesize(FormSubmitterInterface::CLASS); + $this->batchStorage = $this->prophesize(BatchStorageInterface::CLASS); + $this->requestStack = new RequestStack(); + } + + protected function setupBatchProcessor() { + return new BatchProcessor('core', $this->batchQueue->reveal(), $this->dateFormatter->reveal(), $this->formSubmitter->reveal(), $this->batchStorage->reveal(), $this->requestStack); + } + }