Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created October 7, 2013 12:25
Show Gist options
  • Save alnutile/6867001 to your computer and use it in GitHub Desktop.
Save alnutile/6867001 to your computer and use it in GitHub Desktop.
Services Target Action attempt 1
<?php
/**
* Implementation of hook_services_resources().
*/
function behat_editor_services_resources() {
$path = drupal_get_path('module', 'behat_editor');
return array('behat_editor' =>
array('targeted_actions' => array(
'run' => array(
'help' => 'Retrieves a Behat Test File',
'file' => array('type' => 'inc', 'module' => 'behat_editor', 'name' => 'includes/behat_editor_run'),
'callback' => 'behat_editor_run',
'access callback' => 'user_access',
'access arguments' => array('behat run test'),
'access arguments append' => FALSE,
'args' => array(
array(
'name' => 'method',
'type' => 'string',
'description' => 'View or Create new file before running the tests',
'source' => array('data'),
'optional' => FALSE,
),
array(
'name' => 'module',
'type' => 'string',
'description' => 'The module which this feature is stored',
'source' => array('path' => 1),
'optional' => FALSE,
),
array(
'name' => 'module',
'type' => 'string',
'description' => 'The name of the file',
'source' => array('path' => 2),
'optional' => FALSE,
),
),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment