Code consistency and new tests.

This commit is contained in:
James Cole
2018-05-12 15:50:01 +02:00
parent a47da92d81
commit 5bf520b6ed
35 changed files with 1262 additions and 1157 deletions

View File

@@ -927,12 +927,15 @@ class BunqRoutine implements RoutineInterface
throw new NotImplementedException;
}
/**
* @param ImportJob $job
* @param ImportJob $importJob
*
* @return void
*/
public function setJob(ImportJob $job): void
public function setImportJob(ImportJob $importJob): void
{
// TODO: Implement setJob() method.
// TODO: Implement setImportJob() method.
throw new NotImplementedException;
}
}

View File

@@ -81,7 +81,7 @@ class FakeRoutine implements RoutineInterface
case 'final':
/** @var StageFinalHandler $handler */
$handler = app(StageFinalHandler::class);
$handler->setJob($this->importJob);
$handler->setImportJob($this->importJob);
$transactions = $handler->getTransactions();
$this->repository->setStatus($this->importJob, 'provider_finished');
$this->repository->setStage($this->importJob, 'final');
@@ -90,14 +90,14 @@ class FakeRoutine implements RoutineInterface
}
/**
* @param ImportJob $job
* @param ImportJob $importJob
*
* @return
*/
public function setJob(ImportJob $job): void
public function setImportJob(ImportJob $importJob): void
{
$this->importJob = $job;
$this->importJob = $importJob;
$this->repository = app(ImportJobRepositoryInterface::class);
$this->repository->setUser($job->user);
$this->repository->setUser($importJob->user);
}
}

View File

@@ -55,7 +55,7 @@ class FileRoutine implements RoutineInterface
// get processor, depending on file type
// is just CSV for now.
$processor = $this->getProcessor();
$processor->setJob($this->importJob);
$processor->setImportJob($this->importJob);
$transactions = $processor->run();
$this->repository->setStatus($this->importJob, 'provider_finished');
@@ -68,13 +68,13 @@ class FileRoutine implements RoutineInterface
}
/**
* @param ImportJob $job
* @param ImportJob $importJob
*
* @return void
*/
public function setJob(ImportJob $job): void
public function setImportJob(ImportJob $importJob): void
{
$this->importJob = $job;
$this->importJob = $importJob;
$this->repository = app(ImportJobRepositoryInterface::class);
$this->repository->setUser($job->user);
}

View File

@@ -40,9 +40,9 @@ interface RoutineInterface
public function run(): void;
/**
* @param ImportJob $job
* @param ImportJob $importJob
*
* @return void
*/
public function setJob(ImportJob $job): void;
public function setImportJob(ImportJob $importJob): void;
}

File diff suppressed because it is too large Load Diff