Skip to content

Commit

Permalink
Merge pull request #13965 from eileenmcnaughton/member_test
Browse files Browse the repository at this point in the history
Remove reference to non-iso date format from membership form tests
  • Loading branch information
eileenmcnaughton authored Apr 5, 2019
2 parents 912924a + 8b40844 commit 0a4a07b
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions tests/phpunit/CRM/Member/Form/MembershipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ public function testFormRuleEmptyContact() {
*/
public function testFormRuleRollingEarlyStart() {
$unixNow = time();
$ymdNow = date('m/d/Y', $unixNow);
$unixYesterday = $unixNow - (24 * 60 * 60);
$ymdYesterday = date('m/d/Y', $unixYesterday);
$ymdYesterday = date('Y-m-d', $unixYesterday);
$params = array(
'join_date' => $ymdNow,
'join_date' => date('Y-m-d'),
'start_date' => $ymdYesterday,
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -199,12 +198,11 @@ public function testFormRuleRollingEarlyStart() {
*/
public function testFormRuleRollingEarlyEnd() {
$unixNow = time();
$ymdNow = date('m/d/Y', $unixNow);
$unixYesterday = $unixNow - (24 * 60 * 60);
$ymdYesterday = date('m/d/Y', $unixYesterday);
$ymdYesterday = date('Y-m-d', $unixYesterday);
$params = array(
'join_date' => $ymdNow,
'start_date' => $ymdNow,
'join_date' => date('Y-m-d'),
'start_date' => date('Y-m-d'),
'end_date' => $ymdYesterday,
'membership_type_id' => array('23', '15'),
);
Expand All @@ -220,11 +218,10 @@ public function testFormRuleRollingEarlyEnd() {
*/
public function testFormRuleRollingEndNoStart() {
$unixNow = time();
$ymdNow = date('m/d/Y', $unixNow);
$unixYearFromNow = $unixNow + (365 * 24 * 60 * 60);
$ymdYearFromNow = date('m/d/Y', $unixYearFromNow);
$ymdYearFromNow = date('Y-m-d', $unixYearFromNow);
$params = array(
'join_date' => $ymdNow,
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => $ymdYearFromNow,
'membership_type_id' => array('23', '15'),
Expand All @@ -244,9 +241,9 @@ public function testFormRuleRollingLifetimeEnd() {
$unixNow = time();
$unixYearFromNow = $unixNow + (365 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unixNow),
'start_date' => date('m/d/Y', $unixNow),
'end_date' => date('m/d/Y',
'join_date' => date('Y-m-d'),
'start_date' => date('Y-m-d'),
'end_date' => date('Y-m-d',
$unixYearFromNow
),
'membership_type_id' => array('23', '25'),
Expand All @@ -265,7 +262,7 @@ public function testFormRuleRollingLifetimeEnd() {
public function testFormRulePermanentOverrideWithNoStatus() {
$unixNow = time();
$params = array(
'join_date' => date('m/d/Y', $unixNow),
'join_date' => date('Y-m-d'),
'membership_type_id' => array('23', '25'),
'is_override' => TRUE,
);
Expand All @@ -278,11 +275,11 @@ public function testFormRulePermanentOverrideWithNoStatus() {

public function testFormRuleUntilDateOverrideWithValidOverrideEndDate() {
$params = array(
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'membership_type_id' => array('23', '25'),
'is_override' => TRUE,
'status_id' => 1,
'status_override_end_date' => date('m/d/Y', time()),
'status_override_end_date' => date('Y-m-d'),
);
$files = array();
$membershipForm = new CRM_Member_Form_Membership();
Expand All @@ -292,7 +289,7 @@ public function testFormRuleUntilDateOverrideWithValidOverrideEndDate() {

public function testFormRuleUntilDateOverrideWithNoOverrideEndDate() {
$params = array(
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'membership_type_id' => array('23', '25'),
'is_override' => CRM_Member_StatusOverrideTypes::UNTIL_DATE,
'status_id' => 1,
Expand All @@ -312,7 +309,7 @@ public function testFormRuleRollingJoin1MonthFromNow() {
$unixNow = time();
$unix1MFmNow = $unixNow + (31 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unix1MFmNow),
'join_date' => date('Y-m-d', $unix1MFmNow),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -330,9 +327,8 @@ public function testFormRuleRollingJoin1MonthFromNow() {
* Test CRM_Member_Form_Membership::formRule() with a join date of today and a rolling membership type.
*/
public function testFormRuleRollingJoinToday() {
$unixNow = time();
$params = array(
'join_date' => date('m/d/Y', $unixNow),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -353,7 +349,7 @@ public function testFormRuleRollingJoin1MonthAgo() {
$unixNow = time();
$unix1MAgo = $unixNow - (31 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unix1MAgo),
'join_date' => date('Y-m-d', $unix1MAgo),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -373,7 +369,7 @@ public function testFormRuleRollingJoin6MonthsAgo() {
$unixNow = time();
$unix6MAgo = $unixNow - (180 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unix6MAgo),
'join_date' => date('Y-m-d', $unix6MAgo),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -394,7 +390,7 @@ public function testFormRuleRollingJoin1YearAgo() {
$unixNow = time();
$unix1YAgo = $unixNow - (370 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unix1YAgo),
'join_date' => date('Y-m-d', $unix1YAgo),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -415,7 +411,7 @@ public function testFormRuleRollingJoin2YearsAgo() {
$unixNow = time();
$unix2YAgo = $unixNow - (2 * 365 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unix2YAgo),
'join_date' => date('Y-m-d', $unix2YAgo),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '15'),
Expand All @@ -436,7 +432,7 @@ public function testFormRuleFixedJoin6MonthsAgo() {
$unixNow = time();
$unix6MAgo = $unixNow - (180 * 24 * 60 * 60);
$params = array(
'join_date' => date('m/d/Y', $unix6MAgo),
'join_date' => date('Y-m-d', $unix6MAgo),
'start_date' => '',
'end_date' => '',
'membership_type_id' => array('23', '7'),
Expand Down Expand Up @@ -564,7 +560,7 @@ public function testContributionUpdateOnMembershipTypeChange() {
CRM_Price_BAO_PriceSet::buildPriceSet($form);
$params = array(
'cid' => $this->_individualId,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
// This format reflects the 23 being the organisation & the 25 being the type.
Expand Down Expand Up @@ -612,7 +608,7 @@ public function testContributionUpdateOnMembershipTypeChange() {
$form->_action = CRM_Core_Action::UPDATE;
$params = array(
'cid' => $this->_individualId,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
// This format reflects the 23 being the organisation & the 25 being the type.
Expand Down Expand Up @@ -662,7 +658,7 @@ public function testSubmitPartialPayment($thousandSeparator) {
CRM_Price_BAO_PriceSet::buildPriceSet($form);
$params = array(
'cid' => $this->_individualId,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
// This format reflects the 23 being the organisation & the 25 being the type.
Expand Down Expand Up @@ -829,7 +825,7 @@ public function testSubmitPayLaterWithBilling() {
$this->createLoggedInUser();
$params = array(
'cid' => $this->_individualId,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
// This format reflects the 23 being the organisation & the 25 being the type.
Expand Down Expand Up @@ -1116,7 +1112,7 @@ protected function getBaseSubmitParams() {
$params = array(
'cid' => $this->_individualId,
'price_set_id' => 0,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
'campaign_id' => '',
Expand Down Expand Up @@ -1206,7 +1202,7 @@ protected function createTwoMembershipsViaPriceSetInBackEnd($contactId) {
// register for both of these memberships via backoffice membership form submission
$params = array(
'cid' => $contactId,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
// This format reflects the 23 being the organisation & the 25 being the type.
Expand Down Expand Up @@ -1314,7 +1310,7 @@ public function testLineItemAmountOnSalesTax() {
$form->_priceSet = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSet['id']));
$params = array(
'cid' => $this->_individualId,
'join_date' => date('m/d/Y', time()),
'join_date' => date('Y-m-d'),
'start_date' => '',
'end_date' => '',
// This format reflects the 23 being the organisation & the 25 being the type.
Expand Down

0 comments on commit 0a4a07b

Please sign in to comment.