3 namespace Drupal\KernelTests\Core\Batch;
5 use Drupal\KernelTests\KernelTestBase;
8 * Tests batch functionality.
12 class BatchKernelTest extends KernelTestBase {
17 protected function setUp() {
20 require_once $this->root . '/core/includes/batch.inc';
24 * Tests _batch_needs_update().
26 public function testNeedsUpdate() {
27 // Before ever being called, the return value should be FALSE.
28 $this->assertEquals(FALSE, _batch_needs_update());
30 // Set the value to TRUE.
31 $this->assertEquals(TRUE, _batch_needs_update(TRUE));
32 // Check that without a parameter TRUE is returned.
33 $this->assertEquals(TRUE, _batch_needs_update());
35 // Set the value to FALSE.
36 $this->assertEquals(FALSE, _batch_needs_update(FALSE));
37 $this->assertEquals(FALSE, _batch_needs_update());