Index: services.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/services.info,v
retrieving revision 1.11
diff -u -p -r1.11 services.info
--- services.info	24 Dec 2010 17:25:13 -0000	1.11
+++ services.info	17 Jan 2011 19:34:14 -0000
@@ -1,10 +1,8 @@
-; $Id: services.info,v 1.11 2010/12/24 17:25:13 ocyrus Exp $
 name = Services
 description = Provide an API for creating web services.
 package = Services
 core = 7.x
-php = 5.x
-
+dependencies[] = ctools
 files[] = services.module
 files[] = services.admin.inc
 files[] = services.authentication.api.php
@@ -13,8 +11,8 @@ files[] = services.resource_build.inc
 files[] = services.runtime.inc
 files[] = services.servers.api.php
 files[] = serviers.services.api.php
+files[] = tests/services.test
 files[] = tests/functional/NoAuthEndpointTestRunner.test
 files[] = tests/functional/ServicesResourceNodeTests.test
 files[] = tests/functional/ServicesEndpointTests.test
 files[] = tests/unit/TestServicesModule.test
-dependencies[] = ctools
\ No newline at end of file
Index: tests/services.test
===================================================================
RCS file: tests/services.test
diff -N tests/services.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/services.test	17 Jan 2011 19:34:15 -0000
@@ -0,0 +1,329 @@
+<?php
+
+/**
+ * Helper class for Services tests.
+ */
+class ServicesWebTestCase extends DrupalWebTestCase {
+
+  public function setUp() {
+    $args = func_get_args();
+
+    $modules = array();
+    if (isset($args[0]) && is_array($args[0])) {
+      $modules = $args[0];
+    }
+
+    // Add the required module dependencies.
+    array_unshift($modules, 'ctools', 'services', 'rest_server');
+
+    parent::setUp($modules);
+  }
+
+  protected function servicesGet($url, $data = NULL, $parameters = NULL) {
+    $options = array();
+    $url = $this->getAbsoluteUrl($url);
+    $this->pass($url, 'URL');
+    $content = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => url($url, $options), CURLOPT_NOBODY => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => TRUE, CURLOPT_HTTPHEADER => array("Accept: application/json")));
+    $info = curl_getinfo($this->curlHandle);
+    $header = substr($content, 0, $info['header_size']);
+    $status = strtok($header, "\r\n");
+    $code = $info['http_code'];
+    $body = substr($content, -$info['download_content_length']);
+    $this->verbose('GET request to: ' . $url .
+                   '<hr />Ending URL: ' . $this->getUrl() .
+                   '<hr />' . $content);
+    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
+  }
+
+  protected function servicesPost($url, $data = NULL, $headers = array()) {
+    $options = array();
+    $url = $this->getAbsoluteUrl($url);
+    $this->pass($url, 'URL');
+    $content = $this->curlExec(array(CURLOPT_URL => $url, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => TRUE));
+    $info = curl_getinfo($this->curlHandle);
+    $header = substr($content, 0, $info['header_size']);
+    $status = strtok($header, "\r\n");
+    $code = $info['http_code'];
+    $body = substr($content, -$info['download_content_length']);
+    $this->verbose('POST request to: ' . $url .
+                    'data: ' . $data .
+                   '<hr />Ending URL: ' . $this->getUrl() .
+                   '<hr />' . $content);
+    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
+  }
+
+  protected function servicesPut($url, $data = NULL, $headers = array()) {
+    $options = array();
+    $url = $this->getAbsoluteUrl($url);
+    $this->pass($url, 'URL');
+    $putData = tmpfile();
+    // Write the string to the temporary file
+    fwrite($putData, $data);
+    fseek($putData, 0);
+    $content = $this->curlExec(array(CURLOPT_URL => $url,CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers, CURLOPT_INFILE =>$putData, CURLOPT_INFILESIZE => strlen($data)));
+    $info = curl_getinfo($this->curlHandle);
+    $header = substr($content, 0, $info['header_size']);
+    $status = strtok($header, "\r\n");
+    $code = $info['http_code'];
+    $body = substr($content, -$info['download_content_length']);
+    $this->verbose('PUT request to: ' . $url .
+                    'data: ' . $data .
+                   '<hr />Ending URL: ' . $this->getUrl() .
+                   '<hr />' . $content);
+    fclose($putData);
+    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
+  }
+
+  protected function servicesDelete($url, $data = NULL, $headers = array()) {
+    $options = array();
+    $url = $this->getAbsoluteUrl($url);
+    $this->pass($url, 'URL');
+    $content = $this->curlExec(array(CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => TRUE));
+    $info = curl_getinfo($this->curlHandle);
+    $header = substr($content, 0, $info['header_size']);
+    $status = strtok($header, "\r\n");
+    $code = $info['http_code'];
+    $body = substr($content, -$info['download_content_length']);
+    $this->verbose('DELETE request to: ' . $url .
+                    'data: ' . $data .
+                   '<hr />Ending URL: ' . $this->getUrl() .
+                   '<hr />' . $content);
+    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
+  }
+
+   /*
+    ------------------------------------
+    HELPER METHODS
+    ------------------------------------
+   */
+
+   /**
+    * Creates a data array for populating an endpoint creation form.
+    *
+    * @return
+    * An array of fields for fully populating an endpoint creation form.
+    */
+   public function populateEndpointFAPI() {
+     return array(
+       'name'   => 'mchnname',
+       'title'  => $this->randomName(20),
+       'path'   => $this->randomName(10),
+       'server' => 'rest_server',
+     );
+   }
+
+   public function saveNewEndpoint() {
+    $edit = $this->populateEndpointFAPI() ;
+    $endpoint = new stdClass;
+    $endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
+    $endpoint->api_version = 3;
+    $endpoint->name = $edit['name'];
+    $endpoint->title = $edit['title'];
+    $endpoint->server = $edit['server'];
+    $endpoint->path = $edit['path'];
+    $endpoint->authentication = array(
+      'services_sessauth' => array(),
+    );
+    $endpoint->resources = array(
+      'node' => array(
+        'alias' => '',
+        'operations' => array(
+          'create' => array(
+            'enabled' => 1,
+          ),
+          'retrieve' => array(
+            'enabled' => 1,
+          ),
+          'update' => array(
+            'enabled' => 1,
+          ),
+          'delete' => array(
+            'enabled' => 1,
+          ),
+          'index' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'system' => array(
+        'alias' => '',
+        'actions' => array(
+          'connect' => array(
+            'enabled' => 1,
+          ),
+          'get_variable' => array(
+            'enabled' => 1,
+          ),
+          'set_variable' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'taxonomy_term' => array(
+        'alias' => '',
+        'operations' => array(
+          'create' => array(
+            'enabled' => 1,
+          ),
+          'retrieve' => array(
+            'enabled' => 1,
+          ),
+          'update' => array(
+            'enabled' => 1,
+          ),
+          'delete' => array(
+            'enabled' => 1,
+          ),
+        ),
+        'actions' => array(
+          'selectNodes' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'taxonomy_vocabulary' => array(
+        'alias' => '',
+        'operations' => array(
+          'create' => array(
+            'enabled' => 1,
+          ),
+          'retrieve' => array(
+            'enabled' => 1,
+          ),
+          'update' => array(
+            'enabled' => 1,
+          ),
+          'delete' => array(
+            'enabled' => 1,
+          ),
+        ),
+        'actions' => array(
+          'getTree' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'user' => array(
+        'alias' => '',
+        'operations' => array(
+          'create' => array(
+            'enabled' => 1,
+          ),
+          'retrieve' => array(
+            'enabled' => 1,
+          ),
+          'update' => array(
+            'enabled' => 1,
+          ),
+          'delete' => array(
+            'enabled' => 1,
+          ),
+          'index' => array(
+            'enabled' => 1,
+          ),
+        ),
+        'actions' => array(
+          'login' => array(
+            'enabled' => 1,
+          ),
+          'logout' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'comment' => array(
+        'alias' => '',
+        'operations' => array(
+          'create' => array(
+            'enabled' => 1,
+          ),
+          'retrieve' => array(
+            'enabled' => 1,
+          ),
+          'update' => array(
+            'enabled' => 1,
+          ),
+          'delete' => array(
+            'enabled' => 1,
+          ),
+        ),
+        'actions' => array(
+          'loadNodeComments' => array(
+            'enabled' => 1,
+          ),
+          'countAll' => array(
+            'enabled' => 1,
+          ),
+          'countNew' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'file' => array(
+        'alias' => '',
+        'operations' => array(
+          'create' => array(
+            'enabled' => 1,
+          ),
+          'retrieve' => array(
+            'enabled' => 1,
+          ),
+          'delete' => array(
+            'enabled' => 1,
+          ),
+        ),
+        'actions' => array(
+          'nodeFiles' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+      'echo' => array(
+        'alias' => '',
+        'operations' => array(
+          'index' => array(
+            'enabled' => 1,
+          ),
+        ),
+      ),
+    );
+    $endpoint->debug = 1;
+    $endpoint->status = 1;
+    services_endpoint_save($endpoint);
+    $endpoint = services_endpoint_load($endpoint->name);
+    if($endpoint->name == $edit['name']) {
+      $this->pass('Endpoint successfully created');
+    } else {
+       $this->fail('Endpoint creation failed');
+    }
+     $this->servicesGet($endpoint->path);
+     return $endpoint;
+   }
+
+  /**
+   * Builds out our post fields
+   *
+   */
+  public function services_build_postfields($data = array()) {
+    $post_data = '';
+    if (is_array($data) && !empty($data)) {
+      array_walk($data, array($this, 'services_flatten_fields'));
+      $post_data = implode('&', $data);
+    }
+    if(is_object($data) && !empty($data)) {
+      array_walk(get_object_vars($data), array($this, 'services_flatten_fields'));
+      $post_data = implode('&', $data);
+    }
+    return $post_data;
+  }
+
+  /**
+   * Modifies our array data so we can turn it into a querystring
+   *
+   * @param string $item - array value
+   * @param string $key  - key of the array element
+   */
+  public function services_flatten_fields(&$item, $key) {
+    $item = $key .'='. $item;
+  }
+}
Index: tests/functional/NoAuthEndpointTestRunner.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/tests/functional/NoAuthEndpointTestRunner.test,v
retrieving revision 1.4
diff -u -p -r1.4 NoAuthEndpointTestRunner.test
--- tests/functional/NoAuthEndpointTestRunner.test	24 Dec 2010 17:25:13 -0000	1.4
+++ tests/functional/NoAuthEndpointTestRunner.test	17 Jan 2011 19:34:15 -0000
@@ -9,9 +9,6 @@
  *
  */
 
-// Parent class holds the actual tests
-require_once('ServicesEndpointTests.test') ;
-
 /**
  * Sets conditions for a no-authentication set of endpoint test runs.
  */
@@ -21,13 +18,6 @@ require_once('ServicesEndpointTests.test
   protected $privilegedUser = NULL ;
 
    /**
-    * Implementation of setUp().
-    */
-   public function setUp() {
-     parent::setUp();
-   }
-
-   /**
     * Implementation of getInfo().
     */
    public static function getInfo() {
@@ -38,4 +28,4 @@ require_once('ServicesEndpointTests.test
        'group'       => t('Services'),
      ) ;
    }
- }
\ No newline at end of file
+ }
Index: tests/functional/ServicesEndpointTests.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/tests/functional/ServicesEndpointTests.test,v
retrieving revision 1.4
diff -u -p -r1.4 ServicesEndpointTests.test
--- tests/functional/ServicesEndpointTests.test	24 Dec 2010 17:25:13 -0000	1.4
+++ tests/functional/ServicesEndpointTests.test	17 Jan 2011 19:34:15 -0000
@@ -7,7 +7,6 @@
  * Call the endpoint tests when no authentication is being used.
  *
  */
-require_once('ServicesWebTestCase.php') ;
 
 /**
  * Run test cases for the endpoint with no authentication turned on.
@@ -15,18 +14,6 @@ require_once('ServicesWebTestCase.php') 
  */
  class ServicesEndpointTests extends ServicesWebTestCase {
 
-	/**
-    * Implementation of setUp().
-    */
-   public function setUp() {
-     parent::setUp(
-     	'ctools',
-     	'services',
-      'rest_server',
-      'services_sessauth',
-      'inputstream'
-     );
-   }
 /**
     * Test adding an endpoint succeeds.
     */
@@ -126,4 +113,4 @@ require_once('ServicesWebTestCase.php') 
      $this->assertFieldByName('title', $edit['title'],
        t('Title field remains.')) ;
    }
-}
\ No newline at end of file
+}
Index: tests/functional/ServicesResourceNodeTests.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/tests/functional/ServicesResourceNodeTests.test,v
retrieving revision 1.1
diff -u -p -r1.1 ServicesResourceNodeTests.test
--- tests/functional/ServicesResourceNodeTests.test	24 Dec 2010 17:29:42 -0000	1.1
+++ tests/functional/ServicesResourceNodeTests.test	17 Jan 2011 19:34:15 -0000
@@ -4,7 +4,6 @@
  * Call the endpoint tests when no authentication is being used.
  *
  */
-require_once('ServicesWebTestCase.php') ;
 
 /**
  * Run test cases for the endpoint with no authentication turned on.
@@ -12,18 +11,7 @@ require_once('ServicesWebTestCase.php') 
  */
  class ServicesResourceNodeTests extends ServicesWebTestCase {
   protected $privilegedUser = NULL ;
-	/**
-    * Implementation of setUp().
-    */
-   public function setUp() {
-     parent::setUp(
-     	'ctools',
-     	'services',
-      'rest_server',
-      'services_sessauth',
-      'inputstream'
-     );
-   }
+
    public static function getInfo() {
      return array(
        'name'        => t('Resource Node tests, no auth'),
@@ -98,11 +86,11 @@ require_once('ServicesWebTestCase.php') 
       'node[language]' => 'UND',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node);
     $responseArray = $this->servicesPost($endpoint->path.'/node', $data, array('Accept: application/json'));
     $nodeResourceCreateReturn = json_decode($responseArray['body']);
-    
+
     if(isset($nodeResourceCreateReturn->nid)) {
       $this->pass('Node was successfully created',  'NodeResource: Create');
       $newNode = node_load($nodeResourceCreateReturn->nid);
@@ -136,11 +124,11 @@ require_once('ServicesWebTestCase.php') 
       'node[type]' => 'article',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node);
     $responseArray = $this->servicesPost($endpoint->path.'/node', $data, array('Accept: application/json'));
     $nodeResourceCreateReturn = json_decode($responseArray['body']);
-    
+
     if($responseArray['code'] = 401) {
       $this->pass('User with permissions cannot create node',  'NodeResource: Create');
     } else {
@@ -165,7 +153,7 @@ require_once('ServicesWebTestCase.php') 
       'node[name]' => $this->privilegedUser->name,
       'node[type]' => 'article',
     );
-    
+
     $data = $this->services_build_postfields($node_update);
     $responseArray = $this->servicesPost($endpoint->path.'/node', $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
@@ -192,7 +180,7 @@ require_once('ServicesWebTestCase.php') 
       'node[type]' => 'article',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node_update);
     $responseArray = $this->servicesPut($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
@@ -231,7 +219,7 @@ require_once('ServicesWebTestCase.php') 
       'node[body][UND][0][value]' => 'bodytest',
       'node[type]' => 'article',
     );
-    
+
     $data = $this->services_build_postfields($node_update);
     $responseArray = $this->servicesPut($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
@@ -259,7 +247,7 @@ require_once('ServicesWebTestCase.php') 
       'node[body][UND][0][value]' => 'bodytest',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node_update);
     $responseArray = $this->servicesPut($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
Index: tests/functional/ServicesWebTestCase.php
===================================================================
RCS file: tests/functional/ServicesWebTestCase.php
diff -N tests/functional/ServicesWebTestCase.php
--- tests/functional/ServicesWebTestCase.php	24 Dec 2010 17:29:42 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,306 +0,0 @@
-<?php
- class ServicesWebTestCase extends DrupalWebTestCase {
-  protected function servicesGet($url, $data = NULL, $parameters = NULL) {
-    $options = array();
-    $url = $this->getAbsoluteUrl($url);
-    $this->pass($url, 'URL');
-    $content = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => url($url, $options), CURLOPT_NOBODY => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => TRUE, CURLOPT_HTTPHEADER => array("Accept: application/json")));
-    $info = curl_getinfo($this->curlHandle);
-    $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
-    $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
-    $this->verbose('GET request to: ' . $url .
-                   '<hr />Ending URL: ' . $this->getUrl() .
-                   '<hr />' . $content);
-    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
-  }
-  protected function servicesPost($url, $data = NULL, $headers = array()) {
-    $options = array();
-    $url = $this->getAbsoluteUrl($url);
-    $this->pass($url, 'URL');
-    $content = $this->curlExec(array(CURLOPT_URL => $url, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => TRUE));
-    $info = curl_getinfo($this->curlHandle);
-    $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
-    $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
-    $this->verbose('POST request to: ' . $url .
-                    'data: ' . $data .
-                   '<hr />Ending URL: ' . $this->getUrl() .
-                   '<hr />' . $content);
-    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
-  }
-  protected function servicesPut($url, $data = NULL, $headers = array()) {
-    $options = array();
-    $url = $this->getAbsoluteUrl($url);
-    $this->pass($url, 'URL');
-    $putData = tmpfile();
-    // Write the string to the temporary file
-    fwrite($putData, $data);
-    fseek($putData, 0);
-    $content = $this->curlExec(array(CURLOPT_URL => $url,CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers, CURLOPT_INFILE =>$putData, CURLOPT_INFILESIZE => strlen($data)));
-    $info = curl_getinfo($this->curlHandle);
-    $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
-    $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
-    $this->verbose('PUT request to: ' . $url .
-                    'data: ' . $data .
-                   '<hr />Ending URL: ' . $this->getUrl() .
-                   '<hr />' . $content);
-    fclose($putData);
-    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
-  }
-  protected function servicesDelete($url, $data = NULL, $headers = array()) {
-    $options = array();
-    $url = $this->getAbsoluteUrl($url);
-    $this->pass($url, 'URL');
-    $content = $this->curlExec(array(CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => TRUE));
-    $info = curl_getinfo($this->curlHandle);
-    $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
-    $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
-    $this->verbose('DELETE request to: ' . $url .
-                    'data: ' . $data .
-                   '<hr />Ending URL: ' . $this->getUrl() .
-                   '<hr />' . $content);
-    return array('header' => $header, 'status' => $status, 'code' => $code, 'body' => $body);
-  }
-
-   /*
-    ------------------------------------
-    HELPER METHODS
-    ------------------------------------
-   */
-
-   /**
-    * Creates a data array for populating an endpoint creation form.
-    *
-    * @return
-    * An array of fields for fully populating an endpoint creation form.
-    */
-   public function populateEndpointFAPI() {
-     return array(
-       'name'   => 'mchnname',
-       'title'  => $this->randomName(20),
-       'path'   => $this->randomName(10),
-       'server' => 'rest_server',
-     );
-   }
-   public function saveNewEndpoint() {
-    $edit = $this->populateEndpointFAPI() ;
-    $endpoint = new stdClass;
-    $endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
-    $endpoint->api_version = 3;
-    $endpoint->name = $edit['name'];
-    $endpoint->title = $edit['title'];
-    $endpoint->server = $edit['server'];
-    $endpoint->path = $edit['path'];
-    $endpoint->authentication = array(
-      'services_sessauth' => array(),
-    );
-    $endpoint->resources = array(
-      'node' => array(
-        'alias' => '',
-        'operations' => array(
-          'create' => array(
-            'enabled' => 1,
-          ),
-          'retrieve' => array(
-            'enabled' => 1,
-          ),
-          'update' => array(
-            'enabled' => 1,
-          ),
-          'delete' => array(
-            'enabled' => 1,
-          ),
-          'index' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'system' => array(
-        'alias' => '',
-        'actions' => array(
-          'connect' => array(
-            'enabled' => 1,
-          ),
-          'get_variable' => array(
-            'enabled' => 1,
-          ),
-          'set_variable' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'taxonomy_term' => array(
-        'alias' => '',
-        'operations' => array(
-          'create' => array(
-            'enabled' => 1,
-          ),
-          'retrieve' => array(
-            'enabled' => 1,
-          ),
-          'update' => array(
-            'enabled' => 1,
-          ),
-          'delete' => array(
-            'enabled' => 1,
-          ),
-        ),
-        'actions' => array(
-          'selectNodes' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'taxonomy_vocabulary' => array(
-        'alias' => '',
-        'operations' => array(
-          'create' => array(
-            'enabled' => 1,
-          ),
-          'retrieve' => array(
-            'enabled' => 1,
-          ),
-          'update' => array(
-            'enabled' => 1,
-          ),
-          'delete' => array(
-            'enabled' => 1,
-          ),
-        ),
-        'actions' => array(
-          'getTree' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'user' => array(
-        'alias' => '',
-        'operations' => array(
-          'create' => array(
-            'enabled' => 1,
-          ),
-          'retrieve' => array(
-            'enabled' => 1,
-          ),
-          'update' => array(
-            'enabled' => 1,
-          ),
-          'delete' => array(
-            'enabled' => 1,
-          ),
-          'index' => array(
-            'enabled' => 1,
-          ),
-        ),
-        'actions' => array(
-          'login' => array(
-            'enabled' => 1,
-          ),
-          'logout' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'comment' => array(
-        'alias' => '',
-        'operations' => array(
-          'create' => array(
-            'enabled' => 1,
-          ),
-          'retrieve' => array(
-            'enabled' => 1,
-          ),
-          'update' => array(
-            'enabled' => 1,
-          ),
-          'delete' => array(
-            'enabled' => 1,
-          ),
-        ),
-        'actions' => array(
-          'loadNodeComments' => array(
-            'enabled' => 1,
-          ),
-          'countAll' => array(
-            'enabled' => 1,
-          ),
-          'countNew' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'file' => array(
-        'alias' => '',
-        'operations' => array(
-          'create' => array(
-            'enabled' => 1,
-          ),
-          'retrieve' => array(
-            'enabled' => 1,
-          ),
-          'delete' => array(
-            'enabled' => 1,
-          ),
-        ),
-        'actions' => array(
-          'nodeFiles' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-      'echo' => array(
-        'alias' => '',
-        'operations' => array(
-          'index' => array(
-            'enabled' => 1,
-          ),
-        ),
-      ),
-    );
-    $endpoint->debug = 1;
-    $endpoint->status = 1;
-    services_endpoint_save($endpoint);
-    $endpoint = services_endpoint_load($endpoint->name);
-    if($endpoint->name == $edit['name']) {
-      $this->pass('Endpoint successfully created');  
-    } else {
-       $this->fail('Endpoint creation failed');  
-    }
-     $this->servicesGet($endpoint->path);
-     return $endpoint;
-   }
- /**
- * Builds out our post fields
- *
- */
-  public function services_build_postfields($data = array()) {
-    $post_data = '';  
-    if (is_array($data) && !empty($data)) {
-      array_walk($data, array($this, 'services_flatten_fields'));
-      $post_data = implode('&', $data);
-    }
-    if(is_object($data) && !empty($data)) {
-      array_walk(get_object_vars($data), array($this, 'services_flatten_fields'));
-      $post_data = implode('&', $data);
-    }
-    return $post_data;
-  }
-/**
- * Modifies our array data so we can turn it into a querystring
- * 
- * @param string $item - array value
- * @param string $key  - key of the array element
- */
-  public function services_flatten_fields(&$item, $key) {
-    $item = $key .'='. $item;
-  }
-
-}
-?>
\ No newline at end of file
