mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code consistency and new tests.
This commit is contained in:
@@ -64,7 +64,7 @@ class JobConfigurationControllerTest extends TestCase
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
|
||||
// mock calls:
|
||||
$configurator->shouldReceive('setJob')->once();
|
||||
$configurator->shouldReceive('setImportJob')->once();
|
||||
$configurator->shouldReceive('configurationComplete')->once()->andReturn(false);
|
||||
$configurator->shouldReceive('getNextView')->once()->andReturn('import.fake.apply-rules');
|
||||
$configurator->shouldReceive('getNextData')->once()
|
||||
@@ -122,7 +122,7 @@ class JobConfigurationControllerTest extends TestCase
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
|
||||
// mock calls:
|
||||
$configurator->shouldReceive('setJob')->once();
|
||||
$configurator->shouldReceive('setImportJob')->once();
|
||||
$configurator->shouldReceive('configurationComplete')->once()->andReturn(true);
|
||||
$repository->shouldReceive('updateStatus')->withArgs([Mockery::any(), 'ready_to_run']);
|
||||
|
||||
@@ -154,7 +154,7 @@ class JobConfigurationControllerTest extends TestCase
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
|
||||
// mock calls:
|
||||
$configurator->shouldReceive('setJob')->once();
|
||||
$configurator->shouldReceive('setImportJob')->once();
|
||||
$configurator->shouldReceive('configurationComplete')->once()->andReturn(false);
|
||||
$configurator->shouldReceive('configureJob')->withArgs([[]])->once()->andReturn($messages);
|
||||
|
||||
@@ -214,7 +214,7 @@ class JobConfigurationControllerTest extends TestCase
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
|
||||
// mock calls:
|
||||
$configurator->shouldReceive('setJob')->once();
|
||||
$configurator->shouldReceive('setImportJob')->once();
|
||||
$configurator->shouldReceive('configurationComplete')->once()->andReturn(true);
|
||||
$repository->shouldReceive('updateStatus')->withArgs([Mockery::any(), 'ready_to_run']);
|
||||
|
||||
@@ -247,7 +247,7 @@ class JobConfigurationControllerTest extends TestCase
|
||||
$configurator = $this->mock(FakeJobConfiguration::class);
|
||||
|
||||
// mock calls:
|
||||
$configurator->shouldReceive('setJob')->once();
|
||||
$configurator->shouldReceive('setImportJob')->once();
|
||||
$configurator->shouldReceive('configurationComplete')->once()->andReturn(false);
|
||||
$configurator->shouldReceive('configureJob')->once()->andReturn($messages);
|
||||
$repository->shouldReceive('storeFileUpload')->once()->andReturn(new MessageBag);
|
||||
|
@@ -198,7 +198,7 @@ class JobStatusControllerTest extends TestCase
|
||||
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'running']);
|
||||
$routine->shouldReceive('setJob')->once();
|
||||
$routine->shouldReceive('setImportJob')->once();
|
||||
$routine->shouldReceive('run')->once();
|
||||
|
||||
// call thing.
|
||||
@@ -229,7 +229,7 @@ class JobStatusControllerTest extends TestCase
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'running']);
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'error']);
|
||||
$routine->shouldReceive('setJob')->once();
|
||||
$routine->shouldReceive('setImportJob')->once();
|
||||
$routine->shouldReceive('run')->andThrow(new Exception('Unknown exception'));
|
||||
|
||||
// call thing.
|
||||
@@ -260,7 +260,7 @@ class JobStatusControllerTest extends TestCase
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'running']);
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'error']);
|
||||
$routine->shouldReceive('setJob')->once();
|
||||
$routine->shouldReceive('setImportJob')->once();
|
||||
$routine->shouldReceive('run')->andThrow(new FireflyException('Unknown exception'));
|
||||
|
||||
// call thing.
|
||||
@@ -312,7 +312,7 @@ class JobStatusControllerTest extends TestCase
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'storing_data']);
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'storage_finished']);
|
||||
$storage->shouldReceive('setJob')->once();
|
||||
$storage->shouldReceive('setImportJob')->once();
|
||||
$storage->shouldReceive('store')->once();
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ class JobStatusControllerTest extends TestCase
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'storing_data']);
|
||||
$repository->shouldReceive('setStatus')->once()->withArgs([Mockery::any(), 'error']);
|
||||
$storage->shouldReceive('setJob')->once();
|
||||
$storage->shouldReceive('setImportJob')->once();
|
||||
$storage->shouldReceive('store')->once()->andThrow(new FireflyException('Some storage exception.'));
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user