Ejemplo n.º 1
0
 private function _getPopulatedLeavePeriodDataHolder()
 {
     $leavePeriodDataHolder = new LeavePeriodDataHolder();
     $isLeavePeriodStartOnFeb29th = ParameterService::getParameter('isLeavePeriodStartOnFeb29th');
     $nonLeapYearLeavePeriodStartDate = ParameterService::getParameter('nonLeapYearLeavePeriodStartDate');
     $leavePeriodStartDate = ParameterService::getParameter('leavePeriodStartDate');
     $leavePeriodDataHolder->setIsLeavePeriodStartOnFeb29th($isLeavePeriodStartOnFeb29th);
     $leavePeriodDataHolder->setNonLeapYearLeavePeriodStartDate($nonLeapYearLeavePeriodStartDate);
     $leavePeriodDataHolder->setStartDate($leavePeriodStartDate);
     $leavePeriodDataHolder->setDateFormat('Y-m-d');
     return $leavePeriodDataHolder;
 }
 /**
  * Testing end date falling into Feb 29th
  */
 public function testGenerateEndDate17()
 {
     $leavePeriodDataHolder = new LeavePeriodDataHolder();
     $leavePeriodDataHolder->setIsLeavePeriodStartOnFeb29th('No');
     $leavePeriodDataHolder->setDateFormat('Y-m-d');
     $leavePeriodDataHolder->setLeavePeriodStartDate('2011-03-01');
     $leavePeriodEndDate = $this->leavePeriodService->generateEndDate($leavePeriodDataHolder);
     $this->assertEquals('2012-02-29', $leavePeriodEndDate);
 }
 public function testGenerateStartDate16()
 {
     $leavePeriodDataHolder = new LeavePeriodDataHolder();
     $leavePeriodDataHolder->setIsLeavePeriodStartOnFeb29th('Yes');
     $leavePeriodDataHolder->setNonLeapYearLeavePeriodStartDate('04-01');
     $leavePeriodDataHolder->setDateFormat('Y-m-d');
     $leavePeriodDataHolder->setCurrentDate('2014-04-01');
     $leavePeriodStartDate = $this->leavePeriodService->generateStartDate($leavePeriodDataHolder);
     $this->assertEquals('2014-04-01', $leavePeriodStartDate);
 }