Skip to content

Instantly share code, notes, and snippets.

@pcave
Created March 13, 2014 16:58
Show Gist options
  • Save pcave/9532353 to your computer and use it in GitHub Desktop.
Save pcave/9532353 to your computer and use it in GitHub Desktop.
Submit a VBO action with simpletest
<?php
// Create and log in a user that has access to the queue log report.
$this->privileged_user = $this->drupalCreateUser(array(
'view salesforce batch logs',
));
$this->drupalLogin($this->privileged_user);
$this->drupalGet('admin/reports/salesforce/queue');
$this->assertNoOptionSelected('edit-operation', 'action::salesforce_queue_salesforce_queue_item_refresh_item_action', 'Refresh VBO action exists but is not selected.');
$edit = array(
'operation' => 'action::salesforce_queue_salesforce_queue_item_refresh_item_action',
'views_bulk_operations[0]' => '1',
);
$this->drupalPost('admin/reports/salesforce/queue', $edit, 'Execute');
$this->drupalPost(NULL, NULL, 'Confirm');
$this->assertText('Performed Refresh item on 1 item.', 'The text "Performed Refresh item on 1 item." appears on the queue report page.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment