You are here

public function ViewsBulkOperationsActionProcessorTest::testViewsbulkOperationsActionProcessorExclude in Views Bulk Operations (VBO) 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/ViewsBulkOperationsActionProcessorTest.php \Drupal\Tests\views_bulk_operations\Kernel\ViewsBulkOperationsActionProcessorTest::testViewsbulkOperationsActionProcessorExclude()

Tests exclude mode of ViewsBulkOperationsActionProcessor.

@covers ::getPageList @covers ::populateQueue @covers ::process @covers ::initialize

File

tests/src/Kernel/ViewsBulkOperationsActionProcessorTest.php, line 115

Class

ViewsBulkOperationsActionProcessorTest
@coversDefaultClass \Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor @group views_bulk_operations

Namespace

Drupal\Tests\views_bulk_operations\Kernel

Code

public function testViewsbulkOperationsActionProcessorExclude() {
  $vbo_data = [
    'view_id' => 'views_bulk_operations_test',
    'action_id' => 'views_bulk_operations_advanced_test_action',
    'exclude_mode' => TRUE,
    'preconfiguration' => [
      'test_preconfig' => 'test',
      'test_config' => 'unpublish',
    ],
  ];

  // Get list of rows to process from different view pages.
  $selection = [
    1,
    2,
    4,
    18,
  ];
  $vbo_data['list'] = $this
    ->getResultsList($vbo_data, $selection);

  // Execute the action.
  $results = $this
    ->executeAction($vbo_data);
  $this
    ->assertNodeStatuses($vbo_data['list'], $vbo_data['exclude_mode']);
}