/** * Retrieves the files * * @param Employee $employee * @param string $paths * @param string $month * @return void * @author Francisco Iglesias Gómez */ public function retrieveFiles(Employee $employee, $paths, $month) { $pattern = sprintf('/_trabajador_(%s)_/', implode('|', $employee->getPayrolls())); $finder = $this->getAllPayrollFiles($paths, $month)->name($pattern); if (!iterator_count($finder)) { throw new EmployeeHasNoPayrollFiles(sprintf('Employee %s has no payroll files for month %s', $employee->getFullName(), $month)); } return $finder; }
public function testItReturnsRightFullName() { $employee = new Employee('*****@*****.**', 'Fran', 'Iglesias', 'male', array(123456)); $this->assertEquals('Fran Iglesias', $employee->getFullName()); }