Перевод на доменную архитектуру

This commit is contained in:
brusnitsyn
2026-04-26 23:37:50 +09:00
parent 75ca01ffd8
commit f107ebd167
70 changed files with 4656 additions and 2070 deletions

View File

@@ -1,6 +1,7 @@
<?php
use App\Console\Commands\FillReportsFromDate;
use App\Application\Reports\ReportSavePathService;
use App\Models\Department;
use App\Models\User;
use App\Services\AutoReportService;
@@ -279,7 +280,11 @@ it('creates auto-filled report through report service with auto flag and scoped
})
->andReturn(new \App\Models\Report);
$service = new AutoReportService($reportService, app(DateRangeService::class));
$service = new AutoReportService(
$reportService,
app(DateRangeService::class),
\Mockery::mock(ReportSavePathService::class),
);
expect($service->createReportForDate($user, $department, autoFillRange(), false))->toBeTrue();
});
@@ -343,7 +348,11 @@ it('force recreation removes previous report scoped data before storing a new au
->once()
->andReturn(new \App\Models\Report);
$service = new AutoReportService($reportService, app(DateRangeService::class));
$service = new AutoReportService(
$reportService,
app(DateRangeService::class),
\Mockery::mock(ReportSavePathService::class),
);
expect($service->createReportForDate($user, $department, autoFillRange(), true))->toBeTrue()
->and(DB::table('reports')->where('report_id', 55)->exists())->toBeFalse()