protected function setUp()
 {
     $this->dao = new OpenIdProviderDao();
     $fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmOpenidAuthenticationPlugin/test/fixtures/openiduser.yml';
     TestDataService::truncateTables(array('OpenidProvider'));
     TestDataService::populate($fixture);
 }
 protected function setUp()
 {
     $this->reportableService = new ReportableService();
     TestDataService::truncateTables(array('Report', 'ReportGroup'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/test/fixtures/ReportableService.yml');
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/test/fixtures/ReportableService.yml';
 }
Ejemplo n.º 3
0
 public function testSaveLeaveTypeCheckSavedType()
 {
     TestDataService::truncateTables(array('LeaveType'));
     $this->leaveTypeDao->saveLeaveType($this->_getLeaveTypeObjectWithValues());
     $savedLeaveTypes = TestDataService::fetchLastInsertedRecords('LeaveType', 1);
     $this->assertEquals('LTY001', $savedLeaveTypes[0]->getLeaveTypeId());
     $this->assertEquals('Special', $savedLeaveTypes[0]->getLeaveTypeName());
 }
 protected function setUp()
 {
     $this->leavePeriodService = new LeavePeriodService();
     $leaveEntitlementService = new LeaveEntitlementService();
     $leaveEntitlementService->setLeaveEntitlementStrategy(new FIFOEntitlementConsumptionStrategy());
     $this->leavePeriodService->setLeaveEntitlementService($leaveEntitlementService);
     TestDataService::truncateTables(array('LeavePeriodHistory'));
 }
Ejemplo n.º 5
0
 /**
  * Set up method
  */
 protected function setUp()
 {
     TestDataService::truncateTables(array('ModuleDefaultPage', 'HomePage', 'UserRole', 'Module'));
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/test/fixtures/HomePageDao.yml';
     $this->testData = sfYaml::load($this->fixture);
     TestDataService::populate($this->fixture);
     $this->homePageDao = new HomePageDao();
 }
Ejemplo n.º 6
0
 public function testSaveLeavePeriodWithNoId()
 {
     TestDataService::truncateTables(array('LeavePeriod'));
     $leavePeriod = new LeavePeriod();
     $leavePeriod->setStartDate("2010-01-31");
     $leavePeriod->setEndDate("2011-01-31");
     $this->assertTrue($this->leavePeriodDao->saveLeavePeriod($leavePeriod));
     $savedLeavePeriod = TestDataService::fetchObject('LeavePeriod', 1);
     $this->assertEquals($leavePeriod->getLeavePeriodId(), $savedLeavePeriod->getLeavePeriodId());
     $this->assertEquals($leavePeriod->getStartDate(), $savedLeavePeriod->getStartDate());
     $this->assertEquals($leavePeriod->getEndDate(), $savedLeavePeriod->getEndDate());
 }
Ejemplo n.º 7
0
 public function testSaveCandidateForNullId()
 {
     TestDataService::truncateTables(array('JobCandidate'));
     $candidate = new JobCandidate();
     $candidate->id = null;
     $candidate->firstName = "Yasitha";
     $candidate->middleName = "Chathuranga";
     $candidate->lastName = "Pandithawatta";
     $candidate->email = "*****@*****.**";
     $candidate->comment = "ok";
     $candidate->contactNumber = "0777777777";
     $candidate->keywords = "php,java";
     $candidate->dateOfApplication = "2011-07-04";
     $candidate->status = 1;
     $candidate->modeOfApplication = 1;
     $return = $this->candidateDao->saveCandidate($candidate);
     $this->assertTrue($return);
 }
Ejemplo n.º 8
0
 public function testAddEmployee()
 {
     TestDataService::truncateTables(array('Employee'));
     $employee = new Employee();
     $employee->firstName = 'Tester';
     $employee->lastName = 'Jason';
     $employee = $this->employeeDao->saveEmployee($employee);
 }
 protected function setUp()
 {
     TestDataService::truncateTables(array('Config'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmTimePlugin/test/fixtures/MonthlyTimesheetPeriod.yml');
     $this->monthlyTimesheetPeriod = new MonthlyTImesheetPeriod();
 }
Ejemplo n.º 10
0
 /**
  * Testing saveTimesheetItem method for the newly made timesheet Items
  */
 public function testSaveTimesheetItemWithNewTimesheetItem()
 {
     TestDataService::truncateTables(array('TimesheetItem'));
     $timesheetItem = new TimesheetItem();
     $timesheetItem->setTimesheetId(1);
     $timesheetItem->setDate("2011-04-23");
     $timesheetItem->setDuration("5700");
     $timesheetItem->setComment("New Timesheet Item");
     $timesheetItem->setProjectId(1);
     $timesheetItem->setEmployeeId(1);
     $timesheetItem->setActivityId(4);
     $savedNewTimesheetItem = $this->timesheetDao->saveTimesheetItem($timesheetItem);
     $this->assertTrue($savedNewTimesheetItem instanceof TimesheetItem);
     $this->assertEquals('001', $savedNewTimesheetItem->getTimesheetItemId());
     $this->assertEquals($timesheetItem->getTimesheetId(), $savedNewTimesheetItem->getTimesheetId());
     $this->assertEquals($timesheetItem->getDate(), $savedNewTimesheetItem->getDate());
     $this->assertEquals($timesheetItem->getDuration(), $savedNewTimesheetItem->getDuration());
     $this->assertEquals($timesheetItem->getComment(), $savedNewTimesheetItem->getComment());
     $this->assertEquals($timesheetItem->getProjectId(), $savedNewTimesheetItem->getProjectId());
     $this->assertEquals($timesheetItem->getEmployeeId(), $savedNewTimesheetItem->getEmployeeId());
     $this->assertEquals($timesheetItem->getActivityId(), $savedNewTimesheetItem->getActivityId());
 }
Ejemplo n.º 11
0
 /**
  * Set up method
  */
 protected function setUp()
 {
     TestDataService::truncateTables(array('Employee', 'LeaveType', 'LeavePeriod', 'Leave'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmCoreLeavePlugin/test/fixtures/LeaveRequestDaoSearch.yml');
 }
Ejemplo n.º 12
0
 protected function setUp()
 {
     $this->reportableDao = new ReportableDao();
     TestDataService::truncateTables(array('SelectedCompositeDisplayField', 'CompositeDisplayField', 'DisplayField', 'SelectedGroupField', 'GroupField', 'SelectedDisplayField', 'SelectedFilterField', 'FilterField', 'Report', 'ReportGroup', 'ProjectActivity', 'Project', 'Customer'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/test/fixtures/ReportableDao.yml');
 }
Ejemplo n.º 13
0
 protected function setUp()
 {
     TestDataService::truncateTables(array('Kpi'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmPerformancePlugin/test/fixtures/kpi.yml');
 }
 protected function setUp()
 {
     TestDataService::truncateTables(array('PerformanceReview', 'Employee'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmPerformancePlugin/test/fixtures/performance_reviews.yml');
 }
Ejemplo n.º 15
0
 public function testSaveJobInterviewForNullId()
 {
     TestDataService::truncateTables(array('JobInterview', 'JobInterviewInterviewer', 'JobInterviewAttachment'));
     $interview = new JobInterview();
     $interview->setId(null);
     $interview->setInterviewName('1st Interview');
     $interview->setInterviewDate('2011-05-05');
     $return = $this->jobInterviewDao->saveJobInterview($interview);
     $this->assertTrue($return);
 }