feat: 人工费用支持表格导入 #758
177
app/Business/LaborExpenseWorkbookImporter.php
Normal file
177
app/Business/LaborExpenseWorkbookImporter.php
Normal file
@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
namespace App\Business;
|
||||
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use Throwable;
|
||||
|
||||
class LaborExpenseWorkbookImporter
|
||||
{
|
||||
private const MAX_DATA_ROWS = 2000;
|
||||
|
||||
/**
|
||||
* @return array{rows: array<int, array<string, mixed>>, row_count: int, blank_count: int}
|
||||
*/
|
||||
public function import(UploadedFile $file): array
|
||||
{
|
||||
$fields = collect(config('labor_expense_table.fields', []))
|
||||
->filter(static fn (array $field): bool => ($field['kind'] ?? null) !== 'sequence'
|
||||
&& blank($field['formula'] ?? null));
|
||||
|
||||
if ($fields->isEmpty()) {
|
||||
throw ValidationException::withMessages([
|
||||
'import' => '人工费用表没有可导入的录入列。',
|
||||
]);
|
||||
}
|
||||
|
||||
$lookup = [];
|
||||
foreach ($fields as $field) {
|
||||
$lookup[$this->normalizeHeader($field['key'])] = $field['key'];
|
||||
$lookup[$this->normalizeHeader($field['label'])] = $field['key'];
|
||||
}
|
||||
|
||||
$spreadsheet = null;
|
||||
|
||||
try {
|
||||
$readerType = match (mb_strtolower($file->getClientOriginalExtension())) {
|
||||
'xlsx' => 'Xlsx',
|
||||
'xls' => 'Xls',
|
||||
'csv' => 'Csv',
|
||||
default => throw new \RuntimeException('Unsupported workbook format.'),
|
||||
};
|
||||
$reader = IOFactory::createReader($readerType);
|
||||
if (method_exists($reader, 'setReadDataOnly')) {
|
||||
$reader->setReadDataOnly(true);
|
||||
}
|
||||
$spreadsheet = $reader->load($file->getRealPath());
|
||||
[$sheetRows, $headerRow, $columns] = $this->bestSheet($spreadsheet, $lookup);
|
||||
} catch (Throwable) {
|
||||
throw ValidationException::withMessages([
|
||||
'import' => '无法读取导入文件,请确认文件未损坏且格式为 xlsx、xls 或 csv。',
|
||||
]);
|
||||
} finally {
|
||||
if ($spreadsheet) {
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
}
|
||||
}
|
||||
|
||||
if ($sheetRows === null || $columns === []) {
|
||||
throw ValidationException::withMessages([
|
||||
'import' => '未找到当前人工费用表的可录入列,请使用页面“导出全部字段”生成的文件作为模板。',
|
||||
]);
|
||||
}
|
||||
|
||||
$fieldMap = $fields->keyBy('key');
|
||||
$rows = [];
|
||||
$blankCount = 0;
|
||||
|
||||
foreach (array_slice($sheetRows, $headerRow + 1, null, true) as $rowIndex => $row) {
|
||||
$record = [];
|
||||
$hasValue = false;
|
||||
|
||||
foreach ($columns as $columnIndex => $fieldKey) {
|
||||
$field = $fieldMap[$fieldKey];
|
||||
$value = $this->normalizeCell(
|
||||
$row[$columnIndex] ?? null,
|
||||
$field['kind'] ?? 'text',
|
||||
(int) $rowIndex + 1,
|
||||
$field['label'] ?? $fieldKey,
|
||||
);
|
||||
$record[$fieldKey] = $value;
|
||||
$hasValue = $hasValue || $value !== '';
|
||||
}
|
||||
|
||||
if (! $hasValue) {
|
||||
$blankCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$rows[] = $record;
|
||||
if (count($rows) > self::MAX_DATA_ROWS) {
|
||||
throw ValidationException::withMessages([
|
||||
'import' => '单次最多导入 ' . number_format(self::MAX_DATA_ROWS) . ' 行,请拆分文件后重试。',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($rows === []) {
|
||||
throw ValidationException::withMessages([
|
||||
'import' => '表格中没有可导入的数据行。',
|
||||
]);
|
||||
}
|
||||
|
||||
return [
|
||||
'rows' => $rows,
|
||||
'row_count' => count($rows),
|
||||
'blank_count' => $blankCount,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{0: array<int, array<int, mixed>>|null, 1: int|null, 2: array<int, string>}
|
||||
*/
|
||||
private function bestSheet(mixed $spreadsheet, array $lookup): array
|
||||
{
|
||||
$best = [null, null, []];
|
||||
$bestScore = 0;
|
||||
|
||||
foreach ($spreadsheet->getWorksheetIterator() as $worksheet) {
|
||||
$rows = $worksheet->toArray(null, false, false, false);
|
||||
|
||||
foreach (array_slice($rows, 0, 30, true) as $rowIndex => $row) {
|
||||
$columns = [];
|
||||
|
||||
foreach ($row as $columnIndex => $heading) {
|
||||
$key = $this->normalizeHeader($heading);
|
||||
if ($key !== '' && isset($lookup[$key])) {
|
||||
$columns[$columnIndex] = $lookup[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$score = count(array_unique(array_values($columns)));
|
||||
if ($score > $bestScore) {
|
||||
$best = [$rows, (int) $rowIndex, $columns];
|
||||
$bestScore = $score;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $best;
|
||||
}
|
||||
|
||||
private function normalizeCell(mixed $value, string $kind, int $line, string $label): mixed
|
||||
{
|
||||
if ($value === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$text = trim((string) $value);
|
||||
if ($text === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (! in_array($kind, ['number', 'percent'], true)) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$isPercentText = $kind === 'percent' && str_ends_with($text, '%');
|
||||
$number = str_replace([',', ',', '¥', '¥', '%'], '', $text);
|
||||
|
||||
if (! is_numeric($number)) {
|
||||
throw ValidationException::withMessages([
|
||||
'import' => "第 {$line} 行“{$label}”不是有效数字。",
|
||||
]);
|
||||
}
|
||||
|
||||
$normalized = (float) $number;
|
||||
|
||||
return $isPercentText ? $normalized / 100 : $normalized;
|
||||
}
|
||||
|
||||
private function normalizeHeader(mixed $value): string
|
||||
{
|
||||
return mb_strtolower(preg_replace('/[\s\x{FEFF}_\-()()*::]+/u', '', trim((string) $value)));
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ use App\Business\BusinessSummaryCards;
|
||||
use App\Business\InventoryInboundDetailImporter;
|
||||
use App\Business\InventoryWarehouseNameMappingWorkbookImporter;
|
||||
use App\Business\InventoryWarehouseShortNames;
|
||||
use App\Business\LaborExpenseWorkbookImporter;
|
||||
use App\Business\CourierPayableSummaryFilter;
|
||||
use App\Business\CourierPayableSummaryStore;
|
||||
use App\Business\FundForecastTemplate;
|
||||
@ -4742,9 +4743,41 @@ class Pages extends Controller
|
||||
return [
|
||||
'view' => 'business.pages.financial-operations.labor-expenses',
|
||||
'laborExpenseTable' => config('labor_expense_table'),
|
||||
'laborExpenseInitialRows' => session('labor_expense_import_rows', []),
|
||||
'laborExpenseImportMessage' => session('labor_expense_import_message'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function importLaborExpenses(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'import' => ['required', 'file', 'mimes:xlsx,xls,csv', 'max:10240'],
|
||||
]);
|
||||
|
||||
$result = app(LaborExpenseWorkbookImporter::class)->import($request->file('import'));
|
||||
$message = "导入完成:共 {$result['row_count']} 行,公式列已自动重算。";
|
||||
if ($result['blank_count'] > 0) {
|
||||
$message .= " 已忽略 {$result['blank_count']} 个空行。";
|
||||
}
|
||||
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json([
|
||||
'message' => $message,
|
||||
'rows' => $result['rows'],
|
||||
'row_count' => $result['row_count'],
|
||||
'blank_count' => $result['blank_count'],
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('business.pages.show', [
|
||||
'section' => 'financial-operations',
|
||||
'page' => 'labor-expenses',
|
||||
])
|
||||
->with('labor_expense_import_rows', $result['rows'])
|
||||
->with('labor_expense_import_message', $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 税金预测表逻辑配置:规则清单、数据源状态和运行参数。
|
||||
*/
|
||||
@ -9745,6 +9778,10 @@ class Pages extends Controller
|
||||
string $page,
|
||||
?string $tab = null,
|
||||
) {
|
||||
if ($section === 'financial-operations' && $page === 'labor-expenses') {
|
||||
return $this->importLaborExpenses($request);
|
||||
}
|
||||
|
||||
$descriptor = TableRegistry::describe($section, $page, $tab);
|
||||
abort_if(! $descriptor, 404);
|
||||
|
||||
|
||||
@ -5,6 +5,9 @@
|
||||
static fn (array $field): bool => filled($field['formula'] ?? null)
|
||||
);
|
||||
$laborFormulaCount = $laborFormulaFields->count();
|
||||
$laborExpenseInitialRows = is_array($laborExpenseInitialRows ?? null) ? array_values($laborExpenseInitialRows) : [];
|
||||
$laborExpenseImportError = $errors->first('import');
|
||||
$laborExpenseImportMessage = trim((string) ($laborExpenseImportError ?: ($laborExpenseImportMessage ?? '')));
|
||||
@endphp
|
||||
|
||||
<div class="labor-expense-page" data-labor-expense data-finance-table-surface data-directory-page="labor-expenses">
|
||||
@ -107,6 +110,10 @@
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.labor-expense-import-form {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.labor-expense-toolbar .labor-expense-toolbar__legend {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@ -129,6 +136,27 @@
|
||||
background: #f7f0de;
|
||||
}
|
||||
|
||||
.labor-expense-import-status {
|
||||
margin: -0.35rem 0 0.75rem;
|
||||
padding: 0.5rem 0.65rem;
|
||||
border: 1px solid #b9d8c2;
|
||||
border-radius: 0.45rem;
|
||||
background: #f1f9f3;
|
||||
color: #276738;
|
||||
font-size: 0.72rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.labor-expense-import-status[data-state="error"] {
|
||||
border-color: #e2b4b4;
|
||||
background: #fff4f4;
|
||||
color: #a22a2a;
|
||||
}
|
||||
|
||||
.labor-expense-import-status[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.labor-expense-table-wrap {
|
||||
border: 1px solid var(--vip-border, #D8D2C7);
|
||||
border-radius: 0.5rem;
|
||||
@ -403,7 +431,7 @@
|
||||
|
||||
<div class="labor-expense-note" role="note">
|
||||
<span class="material-icons-outlined" aria-hidden="true">info</span>
|
||||
<div>页面不预置源表人员、花名或金额,录入值只在当前页面参与计算;可使用表格上方的导出按钮保存当前结果。</div>
|
||||
<div>页面不预置源表人员、花名或金额。可导入与当前表头一致的 xlsx、xls 或 csv;系统只读取黄色可录入列并自动重算公式。导入会替换当前页面已有行,数据不写入人员明细库,离开页面后清空。</div>
|
||||
</div>
|
||||
|
||||
<div class="finance-table-controls labor-expense-toolbar" data-finance-controls>
|
||||
@ -415,6 +443,20 @@
|
||||
<span class="material-icons-outlined" aria-hidden="true">restart_alt</span>
|
||||
重置表格
|
||||
</button>
|
||||
<form
|
||||
class="labor-expense-import-form"
|
||||
method="POST"
|
||||
enctype="multipart/form-data"
|
||||
action="{{ route('business.pages.import', ['section' => 'financial-operations', 'page' => 'labor-expenses']) }}"
|
||||
data-labor-import-form
|
||||
>
|
||||
@csrf
|
||||
<input type="file" name="import" accept=".xlsx,.xls,.csv" hidden data-labor-import-file>
|
||||
<button type="button" class="finance-table-controls__button" data-labor-import-open>
|
||||
<span class="material-icons-outlined" aria-hidden="true">upload_file</span>
|
||||
导入 Excel/CSV
|
||||
</button>
|
||||
</form>
|
||||
<button type="button" class="finance-table-controls__button" data-directory-export>
|
||||
<span class="material-icons-outlined" aria-hidden="true">download</span>
|
||||
导出当前显示列
|
||||
@ -429,6 +471,15 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<p
|
||||
class="labor-expense-import-status"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
data-labor-import-status
|
||||
data-state="{{ $laborExpenseImportError ? 'error' : 'success' }}"
|
||||
@if ($laborExpenseImportMessage === '') hidden @endif
|
||||
>{{ $laborExpenseImportMessage }}</p>
|
||||
|
||||
<div class="finance-table-scroll-owner labor-expense-table-wrap">
|
||||
<table class="biz-table labor-expense-table" data-finance-table data-labor-expense-table aria-label="人工费用测算表">
|
||||
<thead>
|
||||
@ -484,7 +535,12 @@
|
||||
const tbody = root.querySelector('[data-labor-rows]');
|
||||
const formulaFields = fields.filter((field) => field.formula);
|
||||
const numericKinds = new Set(['number', 'percent']);
|
||||
let rows = [{}];
|
||||
const importForm = root.querySelector('[data-labor-import-form]');
|
||||
const importFile = root.querySelector('[data-labor-import-file]');
|
||||
const importOpen = root.querySelector('[data-labor-import-open]');
|
||||
const importStatus = root.querySelector('[data-labor-import-status]');
|
||||
let rows = @json($laborExpenseInitialRows);
|
||||
if (!Array.isArray(rows) || rows.length === 0) rows = [{}];
|
||||
|
||||
const moneyFormatter = new Intl.NumberFormat('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
@ -930,6 +986,57 @@
|
||||
tbody.querySelector('[data-labor-field="B"]')?.focus();
|
||||
});
|
||||
|
||||
const setImportStatus = (message, state = 'success') => {
|
||||
if (!importStatus) return;
|
||||
importStatus.textContent = message;
|
||||
importStatus.dataset.state = state;
|
||||
importStatus.hidden = message === '';
|
||||
};
|
||||
|
||||
importOpen?.addEventListener('click', () => {
|
||||
const hasEnteredRows = rows.some((row) => Object.values(row).some((value) => (
|
||||
value !== '' && value !== null && value !== undefined
|
||||
)));
|
||||
if (hasEnteredRows && !window.confirm('导入会替换当前页面已有数据,是否继续?')) return;
|
||||
importFile?.click();
|
||||
});
|
||||
|
||||
importFile?.addEventListener('change', async () => {
|
||||
if (!importForm || !importFile.files?.length) return;
|
||||
|
||||
importOpen.disabled = true;
|
||||
setImportStatus('正在读取文件并重算公式…');
|
||||
|
||||
try {
|
||||
const response = await fetch(importForm.action, {
|
||||
method: 'POST',
|
||||
body: new FormData(importForm),
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
},
|
||||
});
|
||||
const payload = await response.json().catch(() => ({}));
|
||||
|
||||
if (!response.ok) {
|
||||
const validationMessage = payload.errors
|
||||
? Object.values(payload.errors).flat().find(Boolean)
|
||||
: null;
|
||||
throw new Error(validationMessage || payload.message || '导入失败,请检查文件表头和数据。');
|
||||
}
|
||||
|
||||
rows = Array.isArray(payload.rows) && payload.rows.length ? payload.rows : [{}];
|
||||
renderRows();
|
||||
setImportStatus(payload.message || `导入完成:共 ${rows.length} 行。`);
|
||||
} catch (error) {
|
||||
setImportStatus(error instanceof Error ? error.message : '导入失败,请稍后重试。', 'error');
|
||||
} finally {
|
||||
importFile.value = '';
|
||||
importOpen.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
renderRows();
|
||||
})();
|
||||
</script>
|
||||
|
||||
@ -6,10 +6,16 @@ use App\Models\Auth\Permission;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\User;
|
||||
use App\Utilities\SidebarPermissions;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use Tests\Feature\FeatureTestCase;
|
||||
|
||||
class LaborExpensePageAccessTest extends FeatureTestCase
|
||||
{
|
||||
/** @var list<string> */
|
||||
private array $laborImportFixtures = [];
|
||||
|
||||
public function test_labor_expense_page_is_visible_only_to_the_named_accounts(): void
|
||||
{
|
||||
$chenxi = $this->account('晨曦');
|
||||
@ -58,6 +64,8 @@ class LaborExpensePageAccessTest extends FeatureTestCase
|
||||
->assertForbidden();
|
||||
$this->post(route('business.pages.store', $routeParameters), [])
|
||||
->assertForbidden();
|
||||
$this->post(route('business.pages.import', $routeParameters), [])
|
||||
->assertForbidden();
|
||||
|
||||
$this->withExceptionHandling()->loginAs($this->user)
|
||||
->get(route('business.pages.show', $routeParameters))
|
||||
@ -87,6 +95,8 @@ class LaborExpensePageAccessTest extends FeatureTestCase
|
||||
->assertSeeText('汇算清缴')
|
||||
->assertSee('data-labor-expense', false)
|
||||
->assertSee('data-labor-expense-table', false)
|
||||
->assertSee('data-labor-import-form', false)
|
||||
->assertSee('data-labor-import-open', false)
|
||||
->assertSee('=F#-G#-H#-I#', false)
|
||||
->assertSee('=IF(AN#<=0,0,IF(AN#<=4000,800,AN#*0.2))', false)
|
||||
->assertSee('=IF(J#<=0,"",IF(J#<=3000,0.03', false)
|
||||
@ -108,6 +118,75 @@ class LaborExpensePageAccessTest extends FeatureTestCase
|
||||
$this->assertSame(52, substr_count($html, 'class="labor-expense-formula"'));
|
||||
}
|
||||
|
||||
public function test_labor_expense_workbook_import_returns_editable_rows(): void
|
||||
{
|
||||
$chenxi = $this->account('晨曦');
|
||||
$file = $this->laborWorkbook([
|
||||
['基础信息', '基础信息', '基础信息', '基础信息', '原数据', '原数据', '原数据'],
|
||||
['花名', '姓名', '中心', '职位', '8月应发工资', '原社保个人扣款', '原公积金个人扣款'],
|
||||
['测试花名', '测试姓名', '测试中心', '测试职位', 10000.5, 800, 500],
|
||||
]);
|
||||
|
||||
$response = $this->withExceptionHandling()
|
||||
->loginAs($chenxi)
|
||||
->withHeaders(['Accept' => 'application/json'])
|
||||
->post(route('business.pages.import', [
|
||||
'section' => 'financial-operations',
|
||||
'page' => 'labor-expenses',
|
||||
]), ['import' => $file]);
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonPath('row_count', 1)
|
||||
->assertJsonPath('rows.0.B', '测试花名')
|
||||
->assertJsonPath('rows.0.C', '测试姓名')
|
||||
->assertJsonPath('rows.0.D', '测试中心')
|
||||
->assertJsonPath('rows.0.E', '测试职位')
|
||||
->assertJsonPath('rows.0.F', 10000.5)
|
||||
->assertJsonPath('rows.0.G', 800)
|
||||
->assertJsonPath('rows.0.H', 500)
|
||||
->assertJsonMissingPath('rows.0.J');
|
||||
}
|
||||
|
||||
public function test_labor_expense_import_redirect_keeps_rows_for_non_ajax_form(): void
|
||||
{
|
||||
$chenxi = $this->account('晨曦');
|
||||
$file = $this->laborWorkbook([
|
||||
['花名', '姓名', '8月应发工资', '原社保个人扣款', '原公积金个人扣款'],
|
||||
['测试花名', '测试姓名', 9000, 600, 400],
|
||||
]);
|
||||
|
||||
$response = $this->loginAs($chenxi)->post(route('business.pages.import', [
|
||||
'section' => 'financial-operations',
|
||||
'page' => 'labor-expenses',
|
||||
]), ['import' => $file]);
|
||||
|
||||
$response->assertRedirect(route('business.pages.show', [
|
||||
'section' => 'financial-operations',
|
||||
'page' => 'labor-expenses',
|
||||
]))->assertSessionHas('labor_expense_import_rows.0.B', '测试花名')
|
||||
->assertSessionHas('labor_expense_import_message');
|
||||
}
|
||||
|
||||
public function test_labor_expense_import_rejects_a_file_without_matching_headers(): void
|
||||
{
|
||||
$chenxi = $this->account('晨曦');
|
||||
$file = $this->laborWorkbook([
|
||||
['错误表头'],
|
||||
['无法识别'],
|
||||
]);
|
||||
|
||||
$response = $this->withExceptionHandling()
|
||||
->loginAs($chenxi)
|
||||
->withHeaders(['Accept' => 'application/json'])
|
||||
->post(route('business.pages.import', [
|
||||
'section' => 'financial-operations',
|
||||
'page' => 'labor-expenses',
|
||||
]), ['import' => $file]);
|
||||
|
||||
$response->assertUnprocessable()
|
||||
->assertJsonValidationErrors('import');
|
||||
}
|
||||
|
||||
public function test_basic_deduction_tax_amount_and_housing_fund_base_are_formula_driven(): void
|
||||
{
|
||||
$fields = collect(config('labor_expense_table.fields'))->keyBy('key');
|
||||
@ -225,4 +304,40 @@ class LaborExpensePageAccessTest extends FeatureTestCase
|
||||
|
||||
return $bases;
|
||||
}
|
||||
|
||||
private function laborWorkbook(array $rows): UploadedFile
|
||||
{
|
||||
$temporaryPath = tempnam(sys_get_temp_dir(), 'labor-expense-import-');
|
||||
if ($temporaryPath === false) {
|
||||
throw new \RuntimeException('Unable to create labor expense import fixture.');
|
||||
}
|
||||
|
||||
$path = $temporaryPath . '.xlsx';
|
||||
@unlink($temporaryPath);
|
||||
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$spreadsheet->getActiveSheet()->fromArray($rows, null, 'A1');
|
||||
(new Xlsx($spreadsheet))->save($path);
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
$this->laborImportFixtures[] = $path;
|
||||
|
||||
return new UploadedFile(
|
||||
$path,
|
||||
'labor-expense.xlsx',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
null,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
foreach ($this->laborImportFixtures as $path) {
|
||||
if (is_file($path)) {
|
||||
@unlink($path);
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user