This fixes the tests (must still upload test database).

This commit is contained in:
James Cole
2017-06-24 12:38:24 +02:00
parent 8e3ba7caf2
commit 5fbc319b20
8 changed files with 127 additions and 352 deletions

View File

@@ -22,10 +22,8 @@ interface ConfiguratorInterface
{
/**
* ConfiguratorInterface constructor.
*
* @param ImportJob $job
*/
public function __construct(ImportJob $job);
public function __construct();
/**
* Store any data from the $data array into the job.
@@ -36,6 +34,13 @@ interface ConfiguratorInterface
*/
public function configureJob(array $data): bool;
/**
* @param ImportJob $job
*
* @return void
*/
public function setJob(ImportJob $job);
/**
* Return the data required for the next step in the job configuration.
*

View File

@@ -28,14 +28,11 @@ class CsvConfigurator implements ConfiguratorInterface
{
private $job;
public function __construct(ImportJob $job)
/**
* ConfiguratorInterface constructor.
*/
public function __construct()
{
$this->job = $job;
if (is_null($this->job->configuration) || count($this->job->configuration) === 0) {
Log::debug(sprintf('Gave import job %s initial configuration.', $this->job->key));
$this->job->configuration = config('csv.default_config');
$this->job->save();
}
}
/**
@@ -116,6 +113,19 @@ class CsvConfigurator implements ConfiguratorInterface
return false;
}
/**
* @param ImportJob $job
*/
public function setJob(ImportJob $job)
{
$this->job = $job;
if (is_null($this->job->configuration) || count($this->job->configuration) === 0) {
Log::debug(sprintf('Gave import job %s initial configuration.', $this->job->key));
$this->job->configuration = config('csv.default_config');
$this->job->save();
}
}
/**
* @return string
* @throws FireflyException

View File

@@ -37,16 +37,23 @@ class ImportRoutine
/**
* ImportRoutine constructor.
*
* @param ImportJob $job
*/
public function __construct(ImportJob $job)
public function __construct()
{
$this->job = $job;
$this->journals = new Collection;
$this->errors = new Collection;
Log::debug(sprintf('Job ID is #%d', $job->id));
}
/**
* @param ImportJob $job
*/
public function setJob(ImportJob $job)
{
$this->job = $job;
}
/**
*
*/