From 84f5f7043ee4228f7dfd18700c9b11dd85bc3e1a Mon Sep 17 00:00:00 2001
From: Bram Goffings <bramgoffings@gmail.com>
Date: Tue, 22 May 2012 15:44:32 +0200
Subject: [PATCH] entity controller psr-0

---
 .../tests/{ => modules/field_test}/field.test      |    0
 .../{ => modules/field_test}/field_test.entity.inc |   21 ---------------
 .../{ => modules/field_test}/field_test.field.inc  |    0
 .../tests/{ => modules/field_test}/field_test.info |    1 -
 .../{ => modules/field_test}/field_test.install    |    0
 .../{ => modules/field_test}/field_test.module     |    0
 .../field_test}/field_test.storage.inc             |    0
 .../field_test/TestEntityBundleController.php      |   28 ++++++++++++++++++++
 8 files changed, 28 insertions(+), 22 deletions(-)
 rename core/modules/field/tests/{ => modules/field_test}/field.test (100%)
 rename core/modules/field/tests/{ => modules/field_test}/field_test.entity.inc (95%)
 rename core/modules/field/tests/{ => modules/field_test}/field_test.field.inc (100%)
 rename core/modules/field/tests/{ => modules/field_test}/field_test.info (81%)
 rename core/modules/field/tests/{ => modules/field_test}/field_test.install (100%)
 rename core/modules/field/tests/{ => modules/field_test}/field_test.module (100%)
 rename core/modules/field/tests/{ => modules/field_test}/field_test.storage.inc (100%)
 create mode 100644 core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityBundleController.php

diff --git a/core/modules/field/tests/field.test b/core/modules/field/tests/modules/field_test/field.test
similarity index 100%
rename from core/modules/field/tests/field.test
rename to core/modules/field/tests/modules/field_test/field.test
diff --git a/core/modules/field/tests/field_test.entity.inc b/core/modules/field/tests/modules/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/modules/field_test/field_test.entity.inc
index c8ad3d9..b793b2c 100644
--- a/core/modules/field/tests/field_test.entity.inc
+++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc
@@ -5,8 +5,6 @@
  * Defines an entity type.
  */
 
-use Drupal\entity\EntityController;
-
 /**
  * Implements hook_entity_info().
  */
@@ -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/modules/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/modules/field_test/field_test.field.inc
diff --git a/core/modules/field/tests/field_test.info b/core/modules/field/tests/modules/field_test/field_test.info
similarity index 81%
rename from core/modules/field/tests/field_test.info
rename to core/modules/field/tests/modules/field_test/field_test.info
index 5fc9b27..44d5233 100644
--- a/core/modules/field/tests/field_test.info
+++ b/core/modules/field/tests/modules/field_test/field_test.info
@@ -2,6 +2,5 @@ name = "Field API Test"
 description = "Support module for the Field API tests."
 core = 8.x
 package = Testing
-files[] = field_test.entity.inc
 version = VERSION
 hidden = TRUE
diff --git a/core/modules/field/tests/field_test.install b/core/modules/field/tests/modules/field_test/field_test.install
similarity index 100%
rename from core/modules/field/tests/field_test.install
rename to core/modules/field/tests/modules/field_test/field_test.install
diff --git a/core/modules/field/tests/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module
similarity index 100%
rename from core/modules/field/tests/field_test.module
rename to core/modules/field/tests/modules/field_test/field_test.module
diff --git a/core/modules/field/tests/field_test.storage.inc b/core/modules/field/tests/modules/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/modules/field_test/field_test.storage.inc
diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityBundleController.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityBundleController.php
new file mode 100644
index 0000000..a824765
--- /dev/null
+++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityBundleController.php
@@ -0,0 +1,28 @@
+<?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

