From 2636a3611857b1d853d6b5e9889ff78569e31ff7 Mon Sep 17 00:00:00 2001
From: Bram Goffings <bramgoffings@gmail.com>
Date: Tue, 22 May 2012 17:58:31 +0200
Subject: [PATCH] entity controller move

---
 .../tests/{ => field_test}/field_test.entity.inc   |   23 +---------------
 .../tests/{ => field_test}/field_test.field.inc    |    0
 .../field/tests/{ => field_test}/field_test.info   |    0
 .../tests/{ => field_test}/field_test.install      |    0
 .../field/tests/{ => field_test}/field_test.module |    6 ++--
 .../tests/{ => field_test}/field_test.storage.inc  |    0
 .../field_test/TestEntityBundleController.php      |   29 ++++++++++++++++++++
 7 files changed, 33 insertions(+), 25 deletions(-)
 rename core/modules/field/tests/{ => field_test}/field_test.entity.inc (95%)
 rename core/modules/field/tests/{ => field_test}/field_test.field.inc (100%)
 rename core/modules/field/tests/{ => field_test}/field_test.info (100%)
 rename core/modules/field/tests/{ => field_test}/field_test.install (100%)
 rename core/modules/field/tests/{ => field_test}/field_test.module (96%)
 rename core/modules/field/tests/{ => field_test}/field_test.storage.inc (100%)
 create mode 100644 core/modules/field/tests/field_test/lib/Drupal/field_test/TestEntityBundleController.php

diff --git a/core/modules/field/tests/field_test.entity.inc b/core/modules/field/tests/field_test/field_test.entity.inc
similarity index 95%
rename from core/modules/field/tests/field_test.entity.inc
rename to core/modules/field/tests/field_test/field_test.entity.inc
index c8ad3d9..9185b85 100644
--- a/core/modules/field/tests/field_test.entity.inc
+++ b/core/modules/field/tests/field_test/field_test.entity.inc
@@ -5,8 +5,6 @@
  * Defines an entity type.
  */
 
-use Drupal\entity\EntityController;
-
 /**
  * Implements hook_entity_info().
  */
@@ -68,7 +66,7 @@ function field_test_entity_info() {
       'name' => t('Test Entity with a specified bundle.'),
       'base table' => 'test_entity_bundle',
       'fieldable' => TRUE,
-      'controller class' => 'TestEntityBundleController',
+      'controller class' => 'Drupal\field_test\TestEntityBundleController',
       'field cache' => FALSE,
       'entity keys' => array(
         'id' => 'ftid',
@@ -476,22 +474,3 @@ function field_test_entity_nested_form_submit($form, &$form_state) {
 
   drupal_set_message(t('test_entities @id_1 and @id_2 have been updated.', array('@id_1' => $entity_1->ftid, '@id_2' => $entity_2->ftid)));
 }
-
-/**
- * Controller class for the test_entity_bundle entity type.
- *
- * This extends the Drupal\entity\EntityController class, adding
- * required special handling for bundles (since they are not stored in the
- * database).
- */
-class TestEntityBundleController extends EntityController {
-
-  protected function attachLoad(&$entities, $revision_id = FALSE) {
-    // Add bundle information.
-    foreach ($entities as $key => $entity) {
-      $entity->fttype = 'test_entity_bundle';
-      $entities[$key] = $entity;
-    }
-    parent::attachLoad($entities, $revision_id);
-  }
-}
diff --git a/core/modules/field/tests/field_test.field.inc b/core/modules/field/tests/field_test/field_test.field.inc
similarity index 100%
rename from core/modules/field/tests/field_test.field.inc
rename to core/modules/field/tests/field_test/field_test.field.inc
diff --git a/core/modules/field/tests/field_test.info b/core/modules/field/tests/field_test/field_test.info
similarity index 100%
rename from core/modules/field/tests/field_test.info
rename to core/modules/field/tests/field_test/field_test.info
diff --git a/core/modules/field/tests/field_test.install b/core/modules/field/tests/field_test/field_test.install
similarity index 100%
rename from core/modules/field/tests/field_test.install
rename to core/modules/field/tests/field_test/field_test.install
diff --git a/core/modules/field/tests/field_test.module b/core/modules/field/tests/field_test/field_test.module
similarity index 96%
rename from core/modules/field/tests/field_test.module
rename to core/modules/field/tests/field_test/field_test.module
index a2da73c..8a4c7cd 100644
--- a/core/modules/field/tests/field_test.module
+++ b/core/modules/field/tests/field_test/field_test.module
@@ -15,9 +15,9 @@
 
 use Drupal\entity\EntityFieldQuery;
 
-require_once DRUPAL_ROOT . '/core/modules/field/tests/field_test.entity.inc';
-require_once DRUPAL_ROOT . '/core/modules/field/tests/field_test.field.inc';
-require_once DRUPAL_ROOT . '/core/modules/field/tests/field_test.storage.inc';
+require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.entity.inc';
+require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.field.inc';
+require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.storage.inc';
 
 /**
  * Implements hook_permission().
diff --git a/core/modules/field/tests/field_test.storage.inc b/core/modules/field/tests/field_test/field_test.storage.inc
similarity index 100%
rename from core/modules/field/tests/field_test.storage.inc
rename to core/modules/field/tests/field_test/field_test.storage.inc
diff --git a/core/modules/field/tests/field_test/lib/Drupal/field_test/TestEntityBundleController.php b/core/modules/field/tests/field_test/lib/Drupal/field_test/TestEntityBundleController.php
new file mode 100644
index 0000000..7f74b9b
--- /dev/null
+++ b/core/modules/field/tests/field_test/lib/Drupal/field_test/TestEntityBundleController.php
@@ -0,0 +1,29 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\field_test\TestEntityBundleController.
+ */
+
+namespace Drupal\field_test;
+
+use Drupal\entity\EntityController;
+
+/**
+ * Controller class for the test_entity_bundle entity type.
+ *
+ * This extends the Drupal\entity\EntityController class, adding
+ * required special handling for bundles (since they are not stored in the
+ * database).
+ */
+class TestEntityBundleController extends EntityController {
+
+  protected function attachLoad(&$entities, $revision_id = FALSE) {
+    // Add bundle information.
+    foreach ($entities as $key => $entity) {
+      $entity->fttype = 'test_entity_bundle';
+      $entities[$key] = $entity;
+    }
+    parent::attachLoad($entities, $revision_id);
+  }
+}
-- 
1.7.4.msysgit.0

