You are here

public function ViewsBulkOperationsBatchTest::testFinished 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::testFinished()
  2. 8 tests/src/Unit/ViewsBulkOperationsBatchTest.php \Drupal\Tests\views_bulk_operations\Unit\ViewsBulkOperationsBatchTest::testFinished()
  3. 8.2 tests/src/Unit/ViewsBulkOperationsBatchTest.php \Drupal\Tests\views_bulk_operations\Unit\ViewsBulkOperationsBatchTest::testFinished()

Tests the finished() method.

@covers ::finished

File

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

Class

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

Namespace

Drupal\Tests\views_bulk_operations\Unit

Code

public function testFinished() {
  $results = [
    'operations' => [
      'Some operation',
      'Some operation',
    ],
  ];
  TestViewsBulkOperationsBatch::finished(TRUE, $results, []);
  $this
    ->assertEquals(TestViewsBulkOperationsBatch::message(), 'Action processing results: Some operation (2).');
  $results = [
    'operations' => [
      'Some operation1',
      'Some operation2',
    ],
  ];
  TestViewsBulkOperationsBatch::finished(TRUE, $results, []);
  $this
    ->assertEquals(TestViewsBulkOperationsBatch::message(), 'Action processing results: Some operation1 (1), Some operation2 (1).');
}