INFRA-132 - Misc
authorTim Otten <totten@civicrm.org>
Sat, 24 Jan 2015 09:18:32 +0000 (01:18 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 24 Jan 2015 09:20:07 +0000 (01:20 -0800)
Civi/Angular/Page/Main.php
api/v3/RelationshipType.php
tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php
tests/phpunit/CRM/Core/Resources/StringsTest.php
tests/phpunit/CRM/Utils/HTMLTest.php
tests/phpunit/Civi/Angular/ManagerTest.php

index 35c098a104c268423a9f2d721ef5426500feebcd..e8e2994f86d0c0a2864ee9f764bd5ffd1b95c005 100644 (file)
@@ -85,4 +85,5 @@ class Main extends \CRM_Core_Page {
       }
     }
   }
+
 }
index dc8da5a358f0b96a881b07e6eeaeba79ab835704..bb046073506d7b6d3746aec6e58264f02f05a455 100644 (file)
@@ -124,4 +124,4 @@ function _civicrm_api3_relationship_type_getlist_defaults($request) {
     'label_field' => 'label_a_b',
     'search_field' => 'label_a_b',
   );
-}
\ No newline at end of file
+}
index 6cf39e5e672b5448623f235ff45256535e368a3a..3ff7705a1bf6523bfa9692419ec40f5ddb616c63 100755 (executable)
@@ -206,7 +206,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_unit' => 'week',
       'subject' => 'subject sched_membership_end_2week',
     );
-    $this->fixtures['sched_on_membership_end_date'] = array( // create()
+    $this->fixtures['sched_on_membership_end_date'] = array(
       'name' => 'sched_on_membership_end_date',
       'title' => 'sched_on_membership_end_date',
       'body_html' => '<p>Your membership expired today</p>',
@@ -220,7 +220,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_unit' => 'hour',
       'subject' => 'subject send reminder on membership_end_date',
     );
-    $this->fixtures['sched_after_1day_membership_end_date'] = array( // create()
+    $this->fixtures['sched_after_1day_membership_end_date'] = array(
       'name' => 'sched_after_1day_membership_end_date',
       'title' => 'sched_after_1day_membership_end_date',
       'body_html' => '<p>Your membership expired yesterday</p>',
@@ -728,22 +728,21 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('Email', 'create', array(
       'is_primary' => 1,
       'contact_id' => $membership->contact_id,
-      'email' => 'member2@example.com'
+      'email' => 'member2@example.com',
     ));
     $this->assertAPISuccess($result);
 
     // end_date=2012-09-15 ; schedule is 2 weeks before end_date
     $this->assertCronRuns(array(
-        array( // Before the 2-week mark, no email
+      array(
+        // Before the 2-week mark, no email
         'time' => '2012-08-31 01:00:00',
         'recipients' => array(),
-        ),
-        /* TODO
-        array( // After the 2-week mark, send an email
-        'time' => '2012-09-01 01:00:00',
-        'recipients' => array(array('member2@example.com')),
-        ),
-        */
+      ),
+      //array( // After the 2-week mark, send an email
+      //'time' => '2012-09-01 01:00:00',
+      //'recipients' => array(array('member2@example.com')),
+      //),
     ));
   }
 
@@ -899,7 +898,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     ));
   }
 
-  function testMembership_referenceDate() {
+  public function testMembership_referenceDate() {
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2)));
 
     $this->assertTrue(is_numeric($membership->id));
@@ -918,11 +917,13 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // start_date=2012-03-15 ; schedule is 2 weeks after start_date
     $this->assertCronRuns(array(
-      array( // After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email
         'time' => '2012-03-29 01:00:00',
         'recipients' => array(array('member@example.com')),
       ),
-      array( // After the 2-week 1day mark, don't send an email
+      array(
+        // After the 2-week 1day mark, don't send an email
         'time' => '2012-03-30 01:00:00',
         'recipients' => array(),
       ),
@@ -939,13 +940,15 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $membership->save();
 
     $this->assertCronRuns(array(
-        array( // After the 13 days of the changed join date 2012-03-29, don't send an email
+      array(
+        // After the 13 days of the changed join date 2012-03-29, don't send an email
         'time' => '2012-04-11 01:00:00',
-        'recipients' => array()
-        ),
-      array( // After the 2-week of the changed join date 2012-03-29, send an email
+        'recipients' => array(),
+      ),
+      array(
+         // After the 2-week of the changed join date 2012-03-29, send an email
         'time' => '2012-04-12 01:00:00',
-        'recipients' => array(array('member@example.com'))
+        'recipients' => array(array('member@example.com')),
       ),
     ));
 
@@ -963,7 +966,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'contact_id' => $membership->contact_id,
       'email' => 'member@example.com',
     ));
-   $result = $this->callAPISuccess('contact', 'create', array_merge($this->fixtures['contact'], array('contact_id' => $membership->contact_id)));
+    $result = $this->callAPISuccess('contact', 'create', array_merge($this->fixtures['contact'], array('contact_id' => $membership->contact_id)));
     $this->assertAPISuccess($result);
 
     $actionScheduleBefore = $this->fixtures['sched_membership_end_2week'];           // Send email 2 weeks before end_date
@@ -977,31 +980,38 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     $this->assertCronRuns(
       array(
-        array( // 1day 2weeks before membership end date(MED), don't send mail
+        array(
+          // 1day 2weeks before membership end date(MED), don't send mail
           'time' => '2012-05-31 01:00:00',
           'recipients' => array(),
         ),
-        array( // 2 weeks before MED, send an email
+        array(
+          // 2 weeks before MED, send an email
           'time' => '2012-06-01 01:00:00',
           'recipients' => array(array('member@example.com')),
         ),
-        array( // 1day before MED, don't send mail
+        array(
+          // 1day before MED, don't send mail
           'time' => '2012-06-14 01:00:00',
           'recipients' => array(),
         ),
-        array( // On MED, send an email
+        array(
+          // On MED, send an email
           'time' => '2012-06-15 00:00:00',
           'recipients' => array(array('member@example.com')),
         ),
-        array( // After 1day of MED, send an email
+        array(
+          // After 1day of MED, send an email
           'time' => '2012-06-16 01:00:00',
           'recipients' => array(array('member@example.com')),
         ),
-        array( // After 1day 1min of MED, don't send an email
+        array(
+          // After 1day 1min of MED, don't send an email
           'time' => '2012-06-17 00:01:00',
           'recipients' => array(),
         ),
-      ));
+      )
+    );
 
     // Assert the timestamp as of when the emails of respective three reminders as configured
     // 2 weeks before, on and 1 day after MED, are sent
@@ -1020,27 +1030,33 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('Contact', 'get', array('id' => $membership->contact_id));
     $this->assertCronRuns(
       array(
-        array( // 1day 2weeks before membership end date(MED), don't send mail
+        array(
+          // 1day 2weeks before membership end date(MED), don't send mail
           'time' => '2012-06-05 01:00:00',
           'recipients' => array(),
         ),
-        array( // 2 weeks before MED, send an email
+        array(
+          // 2 weeks before MED, send an email
           'time' => '2012-06-06 01:00:00',
           'recipients' => array(array('member@example.com')),
         ),
-        array( // 1day before MED, don't send mail
+        array(
+          // 1day before MED, don't send mail
           'time' => '2012-06-19 01:00:00',
           'recipients' => array(),
         ),
-        array( // On MED, send an email
+        array(
+          // On MED, send an email
           'time' => '2012-06-20 00:00:00',
           'recipients' => array(array('member@example.com')),
         ),
-        array( // After 1day of MED, send an email
+        array(
+          // After 1day of MED, send an email
           'time' => '2012-06-21 01:00:00',
           'recipients' => array(array('member@example.com')),
         ),
-        array( // After 1day 1min of MED, don't send an email
+        array(
+          // After 1day 1min of MED, don't send an email
           'time' => '2012-07-21 00:01:00',
           'recipients' => array(),
         ),
index 730c2c992b3177fd33143f20cd565aaeefad9dc6..0b44276ec027175445419073a548c2f349744b32 100644 (file)
@@ -23,7 +23,7 @@
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
@@ -60,4 +60,5 @@ class CRM_Core_Resources_StringsTest extends CiviUnitTestCase {
     file_put_contents("$basedir/hello.html", "<div>{{ts('Hello from HTML')}}</div>");
     return $basedir;
   }
+
 }
index 7e24fa90467122d38a76c3e4b780a8241f0d484b..0af328ec23b146ca95075af44765ad34b81fda8e 100644 (file)
@@ -23,7 +23,7 @@
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
@@ -122,4 +122,5 @@ class CRM_Utils_HTMLTest extends CiviUnitTestCase {
     sort($actualStrings);
     $this->assertEquals($expectedStrings, $actualStrings);
   }
+
 }
index 230cc98e916f6f4bda3d00e5f306c76fa9bd5a23..ce3a4f730dc9abed3b9b1969588d3703ec930b85 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 namespace Civi\Angular;
 
@@ -115,4 +115,5 @@ class ManagerTest extends \CiviUnitTestCase {
     $this->assertTrue(in_array('Save Draft', $strings));
     // If crmMailing changes, feel free to use a different example.
   }
+
 }