mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-20 19:42:02 +00:00
Improve test coverage.
This commit is contained in:
@@ -54,12 +54,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '1Afake_job_' . random_int(1, 10000);
|
||||
$job->key = '1Afake_job_' . $this->randomInt();
|
||||
$job->status = 'has_prereq';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
// mock repositories and configuration handling classes:
|
||||
$repository = $this->mock(ImportJobRepositoryInterface::class);
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
@@ -89,12 +91,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '2Bfake_job_' . random_int(1, 10000);
|
||||
$job->key = '2Bfake_job_' . $this->randomInt();
|
||||
$job->status = 'some_bad_state';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
// mock repositories and configuration handling classes:
|
||||
$repository = $this->mock(ImportJobRepositoryInterface::class);
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
@@ -115,12 +119,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '3Cfake_job_' . random_int(1, 10000);
|
||||
$job->key = '3Cfake_job_' . $this->randomInt();
|
||||
$job->status = 'has_prereq';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
// mock repositories and configuration handling classes:
|
||||
$repository = $this->mock(ImportJobRepositoryInterface::class);
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
@@ -145,12 +151,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '4Dfake_job_' . random_int(1, 10000);
|
||||
$job->key = '4Dfake_job_' . $this->randomInt();
|
||||
$job->status = 'has_prereq';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
$messages = new MessageBag;
|
||||
$messages->add('some', 'srrange message');
|
||||
|
||||
@@ -180,12 +188,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '5Ffake_job_' . random_int(1, 10000);
|
||||
$job->key = '5Ffake_job_' . $this->randomInt();
|
||||
$job->status = 'some_bad_state';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
$messages = new MessageBag;
|
||||
$messages->add('some', 'srrange message');
|
||||
|
||||
@@ -210,12 +220,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '6Efake_job_' . random_int(1, 10000);
|
||||
$job->key = '6Efake_job_' . $this->randomInt();
|
||||
$job->status = 'has_prereq';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
// mock repositories and configuration handling classes:
|
||||
$repository = $this->mock(ImportJobRepositoryInterface::class);
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
@@ -242,12 +254,14 @@ class JobConfigurationControllerTest extends TestCase
|
||||
$file = UploadedFile::fake()->image('avatar.jpg');
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = '7Dfake_job_' . random_int(1, 10000);
|
||||
$job->key = '7Dfake_job_' . $this->randomInt();
|
||||
$job->status = 'has_prereq';
|
||||
$job->provider = 'fake';
|
||||
$job->file_type = '';
|
||||
$job->save();
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
$messages = new MessageBag;
|
||||
$messages->add('some', 'srrange message');
|
||||
|
||||
|
Reference in New Issue
Block a user