mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 15:18:05 +00:00
Improve test coverage.
This commit is contained in:
@@ -56,6 +56,8 @@ class CallbackControllerTest extends TestCase
|
||||
$config = [];
|
||||
$newConfig = ['auth_code' => 'abc'];
|
||||
|
||||
$this->mockDefaultSession();
|
||||
|
||||
// mock calls.
|
||||
$repository->shouldReceive('findByKey')->andReturn(new ImportJob)->once();
|
||||
$repository->shouldReceive('getConfiguration')->andReturn($config)->once();
|
||||
@@ -79,6 +81,7 @@ class CallbackControllerTest extends TestCase
|
||||
|
||||
// mock calls.
|
||||
$repository->shouldReceive('findByKey')->andReturnNull()->once();
|
||||
$this->mockDefaultSession();
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('import.callback.ynab') . '?code=abc&state=def');
|
||||
@@ -91,11 +94,9 @@ class CallbackControllerTest extends TestCase
|
||||
*/
|
||||
public function testYnabBasicNoCode(): void
|
||||
{
|
||||
$repository = $this->mock(ImportJobRepositoryInterface::class);
|
||||
$this->mock(ImportJobRepositoryInterface::class);
|
||||
|
||||
// config for job:
|
||||
$config = [];
|
||||
$newConfig = ['auth_code' => 'abc'];
|
||||
$this->mockDefaultSession();
|
||||
|
||||
// mock calls.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user