From dc63ed2789e53dacf7b5eb13df6adfd5c78459e1 Mon Sep 17 00:00:00 2001
From: Kyle Browning <kylebrowning@me.com>
Date: Fri, 17 Jun 2011 16:47:05 -0700
Subject: [PATCH] Removes endpoint title

---
 plugins/export_ui/services_ctools_export_ui.inc |   10 --------
 tests/functional/ServicesEndpointTests.test     |   26 -----------------------
 tests/services.test                             |    2 -
 tests/unit/TestServicesModule.test              |    2 -
 4 files changed, 0 insertions(+), 40 deletions(-)

diff --git a/plugins/export_ui/services_ctools_export_ui.inc b/plugins/export_ui/services_ctools_export_ui.inc
index ffdce08..7e305e7 100644
--- a/plugins/export_ui/services_ctools_export_ui.inc
+++ b/plugins/export_ui/services_ctools_export_ui.inc
@@ -71,15 +71,6 @@ function services_ctools_export_ui_form(&$form, &$form_state) {
     '#value' => $endpoint,
   );
 
-  $form['title'] = array(
-    '#type'          => 'textfield',
-    '#size'          => 24,
-    '#maxlength'     => 255,
-    '#default_value' => $endpoint->title,
-    '#title'         => t('Endpoint title'),
-    '#required'      => TRUE,
-  );
-
   $servers = services_get_servers();
   $server_opts = array(
     '' => t('-- Select a server'),
@@ -197,7 +188,6 @@ function services_ctools_export_ui_form_submit(&$form, &$form_state) {
   $endpoint = $form_state['values']['endpoint_object'];
 
   $endpoint->name   = $form_state['values']['name'];
-  $endpoint->title  = $form_state['values']['title'];
   $endpoint->server = $form_state['values']['server'];
   $endpoint->path   = $form_state['values']['path'];
   $endpoint->debug  = $form_state['values']['debug'];
diff --git a/tests/functional/ServicesEndpointTests.test b/tests/functional/ServicesEndpointTests.test
index 24b8b88..ae641e1 100644
--- a/tests/functional/ServicesEndpointTests.test
+++ b/tests/functional/ServicesEndpointTests.test
@@ -64,34 +64,10 @@ class ServicesEndpointTests extends ServicesWebTestCase {
 
     $this->assertText('Path to endpoint field is required.',
       t('Endpoint path missing error message.'));
-    $this->assertFieldByName('title', $edit['title'],
-      t('Title field remains.'));
     $this->assertFieldByName('server', 'rest_server',
       t('Server is rest server'));
   }
 
-  /**
-   * Test missing title for endpoint causes an error.
-   */
-  public function testMissingTitle() {
-    $edit = $this->populateEndpointFAPI();
-    unset($edit['title']);
-    $this->privilegedUser = $this->drupalCreateUser(array(
-      'administer services',
-      'administer content types',
-      'administer site configuration',
-    ));
-    $this->drupalLogin($this->privilegedUser);
-    $this->drupalPost('admin/structure/services/add', $edit, t('Save'));
-    $this->assertResponse('200', 'expected 200');
-
-    $this->assertText('Endpoint title field is required.',
-      t('Endpoint title missing error message.'));
-    $this->assertFieldByName('name', $edit['name'],
-      t('Name field remains.'));
-    $this->assertFieldByName('server', 'rest_server',
-      t('Server is rest server'));
-  }
 
   /**
    * Test missing server for endpoint causes an error.
@@ -112,8 +88,6 @@ class ServicesEndpointTests extends ServicesWebTestCase {
       t('Server missing error message.'));
     $this->assertFieldByName('name', $edit['name'],
       t('Name field remains.'));
-    $this->assertFieldByName('title', $edit['title'],
-      t('Title field remains.'));
   }
 
 }
\ No newline at end of file
diff --git a/tests/services.test b/tests/services.test
index 46da1fe..236bd3b 100644
--- a/tests/services.test
+++ b/tests/services.test
@@ -159,7 +159,6 @@ class ServicesWebTestCase extends DrupalWebTestCase {
   public function populateEndpointFAPI() {
     return array(
       'name'   => 'machinename',
-      'title'  => $this->randomName(20),
       'path'   => $this->randomName(10),
       'server' => 'rest_server',
     );
@@ -171,7 +170,6 @@ class ServicesWebTestCase extends DrupalWebTestCase {
     $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();
diff --git a/tests/unit/TestServicesModule.test b/tests/unit/TestServicesModule.test
index 9dc3a27..b27f616 100644
--- a/tests/unit/TestServicesModule.test
+++ b/tests/unit/TestServicesModule.test
@@ -137,7 +137,6 @@ class ServicesModuleTests extends DrupalWebTestCase {
     // Create the endpoint.
     $endpointSettings = array(
        'name'   => 'mchnname',
-       'title'  => $this->randomName(20),
        'path'   => $this->randomName(10),
        'server' => 'rest_server',
     );
@@ -241,7 +240,6 @@ class ServicesModuleTests extends DrupalWebTestCase {
     $string = 'New Service object should have property ';
     $this->assertTrue(property_exists($results, 'eid'), t($string . 'eid.'));
     $this->assertTrue(property_exists($results, 'name'), t($string . 'name.'));
-    $this->assertTrue(property_exists($results, 'title'), t($string . 'title.'));
     $this->assertTrue(property_exists($results, 'server'), t($string . 'server.'));
     $this->assertTrue(property_exists($results, 'path'  ), t($string . 'path.'));
   }
-- 
1.7.3.4

