diff --git a/app/Import/Routine/FileRoutine.php b/app/Import/Routine/FileRoutine.php index 81aa08b086..88e6e62a16 100644 --- a/app/Import/Routine/FileRoutine.php +++ b/app/Import/Routine/FileRoutine.php @@ -76,7 +76,7 @@ class FileRoutine implements RoutineInterface { $this->importJob = $importJob; $this->repository = app(ImportJobRepositoryInterface::class); - $this->repository->setUser($job->user); + $this->repository->setUser($importJob->user); } /** diff --git a/tests/Feature/Controllers/CategoryControllerTest.php b/tests/Feature/Controllers/CategoryControllerTest.php index 2b04f30012..cbd8229807 100644 --- a/tests/Feature/Controllers/CategoryControllerTest.php +++ b/tests/Feature/Controllers/CategoryControllerTest.php @@ -370,7 +370,10 @@ class CategoryControllerTest extends TestCase $accountRepos = $this->mock(AccountRepositoryInterface::class); $collector = $this->mock(JournalCollectorInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class); - $journalRepos->shouldReceive('firstNull')->twice()->andReturn(TransactionJournal::first()); + $month = new Carbon(); + $month->startOfMonth(); + $journal = TransactionJournal::where('date', '>=', $month->format('Y-m-d') . ' 00:00:00')->first(); + $journalRepos->shouldReceive('firstNull')->twice()->andReturn($journal); $accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection);