예제 #1
0
 /**
  * Used in viewHspSummary()
  */
 private static function _saveInitialRecords($year, $hspPlanId)
 {
     if (!HspSummary::recordsExist($year, $hspPlanId)) {
         HspSummary::saveInitialSummary($year, $hspPlanId);
     }
 }
예제 #2
0
 /**
  * This test is to check whether the function throws an excpetion when no employee has been defined.
  */
 public function testSaveInitialSummary3()
 {
     try {
         $this->assertTrue(mysql_query("TRUNCATE TABLE `hs_hr_employee`"), mysql_error());
         HspSummary::saveInitialSummary(date('Y'), 1);
         $this->fail("No exception is thrown when no employee exists");
     } catch (HspSummaryException $e) {
         $this->assertEquals(HspSummaryException::NO_EMPLOYEE_EXISTS, $e->getCode());
     }
 }