Skip to content

Commit

Permalink
PCHR-4002: Fix broken tests. Some tests were ran with admin permissio…
Browse files Browse the repository at this point in the history
…ns set in earlier tests, Fixed by setting permission to empty.
  • Loading branch information
tunbola committed Jul 25, 2018
1 parent 15f8394 commit da2c2cd
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,7 @@ public function testLeaveRequestIsValidShouldReturnAnErrorWhenTheToilToAccrueDoe
}

public function testToilCanBeAccruedWhenToilIsInHoursAndToilToAccrueValueIsNotAValidToilAmountOptionValue() {
$this->setPermissions();
$contactID = 1;
$period = AbsencePeriodFabricator::fabricate([
'start_date' => CRM_Utils_Date::processDate('2016-01-01'),
Expand Down Expand Up @@ -3221,6 +3222,7 @@ public function testLeaveRequestIsValidShouldNotReturnErrorWhenValidationsPass()
public function testCreateAlsoCreatesTheBalanceChangesForTheLeaveRequest() {
$contactID = 1;
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();
$startDate = new DateTime();
$endDate = new DateTime('+5 days');

Expand Down Expand Up @@ -4847,6 +4849,7 @@ public function testTheTimeForFromAndToDateOfLeaveRequestIsAddedCorrectlyWhenLea
$toDate = new DateTime('2016-01-10');
$contactID = 1;
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();

$period = AbsencePeriodFabricator::fabricate([
'start_date' => $fromDate->format('YmdHis'),
Expand Down Expand Up @@ -4895,6 +4898,7 @@ public function testTheTimeForFromAndToDateOfLeaveRequestStaysUntouchedWhenReque
$toDate = new DateTime('2016-01-10 12:34:56');
$contactID = 1;
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();

$period = AbsencePeriodFabricator::fabricate([
'start_date' => $fromDate->format('YmdHis'),
Expand Down Expand Up @@ -4939,6 +4943,7 @@ public function testCreateReturnsFalseForFromEmailParameterWhenFromEmailIsNotCon

$contactID = 1;
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();
$startDate = new DateTime();
$endDate = new DateTime('+5 days');

Expand Down Expand Up @@ -4980,6 +4985,7 @@ public function testCreateReturnsFalseForFromEmailParameterWhenFromEmailIsNotCon
public function testCreateReturnsTrueForFromEmailParameterWhenFromEmailIsConfigured() {
$contactID = 1;
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();
$startDate = new DateTime();
$endDate = new DateTime('+5 days');

Expand Down Expand Up @@ -5027,6 +5033,7 @@ public function testTheTimeForFromAndToDateOfLeaveRequestIsNotModifiedWhenLeaveI
$contactID = 1;
$absenceType = AbsenceTypeFabricator::fabricate(['calculation_unit' => 2]);
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();

$period = AbsencePeriodFabricator::fabricate([
'start_date' => $fromDate->format('YmdHis'),
Expand Down Expand Up @@ -5070,6 +5077,7 @@ public function testTheTimeForFromAndToDateOfLeaveRequestIsAddedCorrectlyWhenLea
$toDate = new DateTime('2016-01-10 15:45:00');
$contactID = 1;
$this->registerCurrentLoggedInContactInSession($contactID);
$this->setPermissions();

$period = AbsencePeriodFabricator::fabricate([
'start_date' => $fromDate->format('YmdHis'),
Expand Down

0 comments on commit da2c2cd

Please sign in to comment.