Improve test coverage.

This commit is contained in:
James Cole
2019-06-29 08:14:28 +02:00
parent cf904eb677
commit 003d07504f
33 changed files with 447 additions and 269 deletions

View File

@@ -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.