コード例 #1
0
 /**
  * @dataProvider _testCalculateBonusDateByMonthDataProvider
  */
 public function testCalculateBonusDateByMonth(Carbon $date, Carbon $expected)
 {
     $actual = $this->salary->calculateBonusDateByMonth($date);
     $this->assertEquals($expected->month, $actual->month);
     $this->assertEquals($expected->year, $actual->year);
     $this->assertEquals($expected->day, $actual->day);
 }
コード例 #2
0
 public function run()
 {
     $commandResult = $this->runCommandPrompt();
     $salaryCalendar = SalaryCalendar::get($commandResult['startDate'], $commandResult['endDate'], $commandResult['year']);
     $csvWriter = Writer::createFromFileObject(new \SplTempFileObject());
     $writer = new CsvFileWriter($csvWriter, $salaryCalendar->calculatePayDays());
     $writer->write($commandResult['path'] . DIRECTORY_SEPARATOR . $commandResult['name']);
 }