Add some test code.

This commit is contained in:
James Cole
2018-09-26 20:35:27 +02:00
parent aa1ae18dbb
commit fea5510700
4 changed files with 382 additions and 4 deletions

View File

@@ -64,7 +64,13 @@ class AssetAccountIbansTest extends TestCase
$two->name = 'Else';
$two->account_type_id = $loan->id;
$collection = new Collection([$one, $two]);
$three = new Account;
$three->id = 66;
$three->name = 'I have IBAN';
$three->iban = 'IBAN';
$three->account_type_id = $loan->id;
$collection = new Collection([$one, $two, $three]);
$repository = $this->mock(AccountRepositoryInterface::class);
$repository->shouldReceive('getAccountsByType')->withArgs(
@@ -73,11 +79,12 @@ class AssetAccountIbansTest extends TestCase
$mapper = new AssetAccountIbans();
$mapping = $mapper->getMap();
$this->assertCount(3, $mapping);
$this->assertCount(4, $mapping);
// assert this is what the result looks like:
$result = [
0 => (string)trans('import.map_do_not_map'),
53 => 'Else (liability)',
66 => 'IBAN (I have IBAN) (liability)',
17 => 'IBAN (Something)',
];
$this->assertEquals($result, $mapping);