From 8d14b1f0c3aa07d475d5bb8cc4ee762f7eb28691 Mon Sep 17 00:00:00 2001
From: PatchRanger <patchranger@gmail.com>
Date: Sat, 4 May 2013 01:05:11 +0700
Subject: [PATCH] Issue #1835214 by Steven Jones, mikeryan, PatchRanger:
 Automated tests failing - Exception thrown in Date2
 migration

---
 date_migrate/date_migrate.module                   |    1 +
 date_migrate/date_migrate.test                     |    4 +++-
 .../date_migrate_example.install                   |    8 +++++++-
 .../date_migrate_example.migrate.inc               |    4 ++--
 .../date_migrate_example.module                    |    3 +++
 5 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/date_migrate/date_migrate.module b/date_migrate/date_migrate.module
index accdcf8..84934cc 100644
--- a/date_migrate/date_migrate.module
+++ b/date_migrate/date_migrate.module
@@ -11,6 +11,7 @@
 function date_migrate_migrate_api() {
   $api = array(
     'api' => 2,
+    'field handlers' => array('DateMigrateFieldHandler'),
   );
   return $api;
 }
diff --git a/date_migrate/date_migrate.test b/date_migrate/date_migrate.test
index 400b2d2..aff18a2 100644
--- a/date_migrate/date_migrate.test
+++ b/date_migrate/date_migrate.test
@@ -25,7 +25,9 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase {
    * Declars the module dependencies for the test.
    */
   function setUp() {
-    parent::setUp('migrate', 'features', 'date', 'date_repeat', 'date_repeat_field', 'date_migrate_example');
+    parent::setUp('migrate', 'features', 'date', 'date_repeat', 'date_repeat_field', 'date_migrate_example', 'date_migrate');
+    // Make sure the migration is registered.
+    migrate_get_module_apis(TRUE);
   }
 
   /**
diff --git a/date_migrate/date_migrate_example/date_migrate_example.install b/date_migrate/date_migrate_example/date_migrate_example.install
index 7a35cec..78da679 100644
--- a/date_migrate/date_migrate_example/date_migrate_example.install
+++ b/date_migrate/date_migrate_example/date_migrate_example.install
@@ -6,9 +6,15 @@
  */
 
 /**
+ * Implements hook_enable().
+ */
+function date_migrate_example_enable() {
+  Migration::registerMigration('DateExampleMigration', 'DateExample', array('group_name' => 'Example'));
+}
+
+/**
  * Implements hook_disable().
  */
 function date_migrate_example_disable() {
   Migration::deregisterMigration('DateExample');
 }
-
diff --git a/date_migrate/date_migrate_example/date_migrate_example.migrate.inc b/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
index 491c27f..ee087a1 100644
--- a/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
+++ b/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
@@ -13,8 +13,8 @@ class DateExampleMigration extends XMLMigration {
   /**
    * Sets up the migration.
    */
-  public function __construct() {
-    parent::__construct();
+  public function __construct($arguments = array()) {
+    parent::__construct($arguments);
     $this->description = t('Example migration into date fields');
 
     $this->map = new MigrateSQLMap($this->machineName,
diff --git a/date_migrate/date_migrate_example/date_migrate_example.module b/date_migrate/date_migrate_example/date_migrate_example.module
index 993bd11..2ed7a61 100644
--- a/date_migrate/date_migrate_example/date_migrate_example.module
+++ b/date_migrate/date_migrate_example/date_migrate_example.module
@@ -13,6 +13,9 @@ include_once 'date_migrate_example.features.inc';
 function date_migrate_example_migrate_api() {
   $api = array(
     'api' => 2,
+    'migrations' => array(
+      'DateExample' => array('class_name' => 'DateExampleMigration')
+    ),
   );
   return $api;
 }
-- 
1.7.9.5

