Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Batch / BatchKernelTest.php
diff --git a/web/core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php b/web/core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php
new file mode 100644 (file)
index 0000000..6240308
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\KernelTests\Core\Batch;
+
+use Drupal\KernelTests\KernelTestBase;
+
+/**
+ * Tests batch functionality.
+ *
+ * @group Batch
+ */
+class BatchKernelTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    require_once $this->root . '/core/includes/batch.inc';
+  }
+
+  /**
+   * Tests _batch_needs_update().
+   */
+  public function testNeedsUpdate() {
+    // Before ever being called, the return value should be FALSE.
+    $this->assertEquals(FALSE, _batch_needs_update());
+
+    // Set the value to TRUE.
+    $this->assertEquals(TRUE, _batch_needs_update(TRUE));
+    // Check that without a parameter TRUE is returned.
+    $this->assertEquals(TRUE, _batch_needs_update());
+
+    // Set the value to FALSE.
+    $this->assertEquals(FALSE, _batch_needs_update(FALSE));
+    $this->assertEquals(FALSE, _batch_needs_update());
+  }
+
+}