From a20f31a0e3f8bcacc22eb33aac686555ac580878 Mon Sep 17 00:00:00 2001
From: Vincent Massaro <vincent.massaro@yale.edu>
Date: Wed, 3 Dec 2014 10:01:17 -0500
Subject: [PATCH] rename protected_node.mail.test to prevent mailsystem from
 trying to load it. See huge assumption in mailsystem_get_classes().

---
 protected_node.info                 |  2 +-
 tests/protected_node.mail.test      | 88 -------------------------------------
 tests/protected_node.mail_test.test | 88 +++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 89 deletions(-)
 delete mode 100644 tests/protected_node.mail.test
 create mode 100644 tests/protected_node.mail_test.test

diff --git a/protected_node.info b/protected_node.info
index 8c879df..6e8f171 100644
--- a/protected_node.info
+++ b/protected_node.info
@@ -12,6 +12,6 @@ files[] = tests/protected_node.test
 files[] = tests/protected_node.per_node.test
 files[] = tests/protected_node.per_type.test
 files[] = tests/protected_node.global.test
-files[] = tests/protected_node.mail.test
+files[] = tests/protected_node.mail_test.test
 files[] = tests/protected_node.private_file.test
 files[] = tests/protected_node.view_mode.test
diff --git a/tests/protected_node.mail.test b/tests/protected_node.mail.test
deleted file mode 100644
index adab68c..0000000
--- a/tests/protected_node.mail.test
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-/**
- * @file Test protected node email functionnality.
- */
-
-/**
- * Configure protected_node to send email.
- */
-class ProtectedNodeMail extends ProtectedNodeBaseTestCase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function getInfo() {
-    return array(
-      'name' => 'Protected node email feature',
-      'description' => "This tests mail features",
-      'group' => 'Protected Node',
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function setUp() {
-    parent::setUp();
-
-    // Log in an Admin.
-    $this->drupalLogin($this->adminUser);
-    // Submit the configuration form.
-    $protected_node_settings = array(
-      'protected_node_use_global_password' => PROTECTED_NODE_PER_NODE_PASSWORD,
-      'protected_node_email_activation' => 1
-    );
-    $this->drupalPost('admin/config/content/protected_node', $protected_node_settings, t('Save configuration'));
-  }
-
-  /**
-   * Test that a mail is send when a protected node is created.
-   */
-  public function testSendMail() {
-    // Log in as Admin.
-    $this->drupalLogin($this->adminUser);
-    // Generate random password.
-    $password = $this->randomName(10);
-    // To parameter.
-    $to = 'example@example.com';
-    // Create a new page node.
-    $this->createProtectedNode($password, $to);
-    // Once the node created logout the User.
-    $this->drupalLogout();
-
-    $mails = $this->drupalGetMails();
-
-    // Check mail subject.
-    $this->assertMail('subject', protected_node_email_subject(), 'The last message subject was "My latest email"');
-
-    // Check mail to parameter.
-    $this->assertEqual($to, $mails[0]['to'], "The mail's to parameter is equal to " . $to, $this->group);
-  }
-
-  /**
-   * Helper method to create a protected node.
-   *
-   * Please make sure the user has the permission to create the node before
-   * calling the method.
-   * @argument password.
-   *
-   * @return node object.
-   */
-  public function createProtectedNode($password, $to) {
-    // Add a new page node that is protected.
-    $node_title = $this->randomName(8);
-    $node_data = array(
-      'title' => $node_title,
-      'body[und][0][value]' => $this->randomName(32),
-      'protected_node_is_protected' => TRUE,
-      'protected_node_passwd[pass1]' => $password,
-      'protected_node_passwd[pass2]' => $password,
-      'protected_node_emails' => $to,
-    );
-    $this->drupalPost('node/add/page', $node_data, t('Save'));
-
-    return $this->drupalGetNodeByTitle($node_title);
-  }
-
-}
diff --git a/tests/protected_node.mail_test.test b/tests/protected_node.mail_test.test
new file mode 100644
index 0000000..adab68c
--- /dev/null
+++ b/tests/protected_node.mail_test.test
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @file Test protected node email functionnality.
+ */
+
+/**
+ * Configure protected_node to send email.
+ */
+class ProtectedNodeMail extends ProtectedNodeBaseTestCase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Protected node email feature',
+      'description' => "This tests mail features",
+      'group' => 'Protected Node',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+
+    // Log in an Admin.
+    $this->drupalLogin($this->adminUser);
+    // Submit the configuration form.
+    $protected_node_settings = array(
+      'protected_node_use_global_password' => PROTECTED_NODE_PER_NODE_PASSWORD,
+      'protected_node_email_activation' => 1
+    );
+    $this->drupalPost('admin/config/content/protected_node', $protected_node_settings, t('Save configuration'));
+  }
+
+  /**
+   * Test that a mail is send when a protected node is created.
+   */
+  public function testSendMail() {
+    // Log in as Admin.
+    $this->drupalLogin($this->adminUser);
+    // Generate random password.
+    $password = $this->randomName(10);
+    // To parameter.
+    $to = 'example@example.com';
+    // Create a new page node.
+    $this->createProtectedNode($password, $to);
+    // Once the node created logout the User.
+    $this->drupalLogout();
+
+    $mails = $this->drupalGetMails();
+
+    // Check mail subject.
+    $this->assertMail('subject', protected_node_email_subject(), 'The last message subject was "My latest email"');
+
+    // Check mail to parameter.
+    $this->assertEqual($to, $mails[0]['to'], "The mail's to parameter is equal to " . $to, $this->group);
+  }
+
+  /**
+   * Helper method to create a protected node.
+   *
+   * Please make sure the user has the permission to create the node before
+   * calling the method.
+   * @argument password.
+   *
+   * @return node object.
+   */
+  public function createProtectedNode($password, $to) {
+    // Add a new page node that is protected.
+    $node_title = $this->randomName(8);
+    $node_data = array(
+      'title' => $node_title,
+      'body[und][0][value]' => $this->randomName(32),
+      'protected_node_is_protected' => TRUE,
+      'protected_node_passwd[pass1]' => $password,
+      'protected_node_passwd[pass2]' => $password,
+      'protected_node_emails' => $to,
+    );
+    $this->drupalPost('node/add/page', $node_data, t('Save'));
+
+    return $this->drupalGetNodeByTitle($node_title);
+  }
+
+}
-- 
1.9.2

