/** * @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); }
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']); }