Fix tests.

This commit is contained in:
James Cole
2018-07-01 09:27:22 +02:00
parent 0502f2a4a5
commit db149ca6e1
50 changed files with 551 additions and 647 deletions

View File

@@ -127,12 +127,14 @@ class ChooseAccountsHandlerTest extends TestCase
'account_mapping' => [
'1234' => '456',
],
'apply_rules' => true,
];
$config = [
'accounts' => [
'accounts' => [
0 => ['id' => 1234, 'name' => 'bunq'],
],
'apply-rules' => true,
];
$expected = $config;
$expected['mapping'][1234] = 456;
@@ -179,12 +181,14 @@ class ChooseAccountsHandlerTest extends TestCase
'account_mapping' => [
'1234' => '456',
],
'apply_rules' => true,
];
$config = [
'accounts' => [
'accounts' => [
0 => ['id' => 1235, 'name' => 'bunq'],
],
'apply-rules' => true,
];
$expected = $config;
$expected['mapping'][0] = 456;
@@ -231,12 +235,14 @@ class ChooseAccountsHandlerTest extends TestCase
'account_mapping' => [
'1234' => '456',
],
'apply_rules' => true,
];
$config = [
'accounts' => [
'accounts' => [
0 => ['id' => 1234, 'name' => 'bunq'],
],
'apply-rules' => true,
];
$expected = $config;
$expected['mapping'][1234] = 0;
@@ -279,11 +285,13 @@ class ChooseAccountsHandlerTest extends TestCase
$job->save();
// data:
$data = ['account_mapping' => []];
$data = ['account_mapping' => [], 'apply_rules' => true,];
$config = [
'accounts' => [
0 => ['id' => 1234, 'name' => 'bunq'],
],
'apply-rules' => true,
];
// mock stuff

View File

@@ -48,16 +48,14 @@ class NewBunqJobHandlerTest extends TestCase
$job->save();
// expected config:
$expected = [
'apply-rules' => true,
];
//$expected = [];
// mock stuff
$repository = $this->mock(ImportJobRepositoryInterface::class);
// mock calls
$repository->shouldReceive('setUser')->once();
$repository->shouldReceive('getConfiguration')->andReturn([])->once();
$repository->shouldReceive('setConfiguration')->withArgs([Mockery::any(), $expected])->once();
//$repository->shouldReceive('getConfiguration')->andReturn([])->once();
//$repository->shouldReceive('setConfiguration')->withArgs([Mockery::any(), $expected])->once();
$handler = new NewBunqJobHandler();
$handler->setImportJob($job);