Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Batch / BatchKernelTest.php
1 <?php
2
3 namespace Drupal\KernelTests\Core\Batch;
4
5 use Drupal\KernelTests\KernelTestBase;
6
7 /**
8  * Tests batch functionality.
9  *
10  * @group Batch
11  */
12 class BatchKernelTest extends KernelTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   protected function setUp() {
18     parent::setUp();
19
20     require_once $this->root . '/core/includes/batch.inc';
21   }
22
23   /**
24    * Tests _batch_needs_update().
25    */
26   public function testNeedsUpdate() {
27     // Before ever being called, the return value should be FALSE.
28     $this->assertEquals(FALSE, _batch_needs_update());
29
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());
34
35     // Set the value to FALSE.
36     $this->assertEquals(FALSE, _batch_needs_update(FALSE));
37     $this->assertEquals(FALSE, _batch_needs_update());
38   }
39
40 }