1 views_handler_field_bulk_form.test public ViewsHandlerFieldBulkFormTest::testNodeFieldBulkForm()

Test Bulk Forms for nodes.


core/modules/views/tests/handlers/views_handler_field_bulk_form.test, line 133
Definition of ViewsHandlerFieldBulkFormTest.




public function testNodeFieldBulkForm() {
  // Create the basic view.
  $this->view->add_item('default', 'field', 'node', 'bulk_form', array(
    'id' => 'bulk_form',
    'table' => 'node',
    'field' => 'bulk_form',
    'relationship' => 'none',

  // Verify that the action select field exists in the view.

  // Verify that the select field contains a node-related action.
  $this->assertOption('edit-action', 'node_delete_action');

  // Verify that the view contains bulk form checkboxes with values that match
  // the ids of the correct entity (in this case, nid).
  $this->assertCorrectBulkFormEntityIds('nid', 'node');

  // Verify that the available actions in the bulk form configuration form
  // belong to node entities by checking that the node_delete_action exists.
  $this->assertFieldByName('options[selected_actions][node_delete_action]', 'node_delete_action', 'Found a checkbox for node_delete_action in the Bulk configuration form.');