You are here

public function BatchKernelTest::testNeedsUpdate in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php \Drupal\KernelTests\Core\Batch\BatchKernelTest::testNeedsUpdate()

Tests _batch_needs_update().

File

core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php, line 26

Class

BatchKernelTest
Tests batch functionality.

Namespace

Drupal\KernelTests\Core\Batch

Code

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());
}