You are here

public function ViewsBulkOperationsBatchTest::testGetBatch in Views Bulk Operations (VBO) 8

Same name and namespace in other branches
  1. 8.3 tests/src/Unit/ViewsBulkOperationsBatchTest.php \Drupal\Tests\views_bulk_operations\Unit\ViewsBulkOperationsBatchTest::testGetBatch()
  2. 8.2 tests/src/Unit/ViewsBulkOperationsBatchTest.php \Drupal\Tests\views_bulk_operations\Unit\ViewsBulkOperationsBatchTest::testGetBatch()
  3. 4.0.x tests/src/Unit/ViewsBulkOperationsBatchTest.php \Drupal\Tests\views_bulk_operations\Unit\ViewsBulkOperationsBatchTest::testGetBatch()

Tests the getBatch() method.

@covers ::getBatch

File

tests/src/Unit/ViewsBulkOperationsBatchTest.php, line 68

Class

ViewsBulkOperationsBatchTest
@coversDefaultClass \Drupal\views_bulk_operations\ViewsBulkOperationsBatch @group views_bulk_operations

Namespace

Drupal\Tests\views_bulk_operations\Unit

Code

public function testGetBatch() {
  $data = [
    'list' => [
      [
        0,
        'en',
        'node',
        1,
      ],
    ],
    'some_data' => [],
    'action_label' => '',
  ];
  $batch = TestViewsBulkOperationsBatch::getBatch($data);
  $this
    ->assertArrayHasKey('title', $batch);
  $this
    ->assertArrayHasKey('operations', $batch);
  $this
    ->assertArrayHasKey('finished', $batch);
}