You are here

public function ViewsBulkOperationsBatchTest::testGetBatch in Views Bulk Operations (VBO) 4.0.x

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 tests/src/Unit/ViewsBulkOperationsBatchTest.php \Drupal\Tests\views_bulk_operations\Unit\ViewsBulkOperationsBatchTest::testGetBatch()
  3. 8.2 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 65

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' => '',
    'finished_callback' => [
      TestViewsBulkOperationsBatch::class,
      'finished',
    ],
  ];
  $batch = TestViewsBulkOperationsBatch::getBatch($data);
  $this
    ->assertArrayHasKey('title', $batch);
  $this
    ->assertArrayHasKey('operations', $batch);
  $this
    ->assertArrayHasKey('finished', $batch);
}