The net worth chart will respect net worth preferences.

This commit is contained in:
James Cole
2018-08-29 10:57:42 +02:00
parent 10d953f336
commit 59f4ecdaa6
9 changed files with 409 additions and 4 deletions

View File

@@ -171,6 +171,11 @@ class StageImportDataHandlerTest extends TestCase
$accountFactory->shouldReceive('create')->withArgs([$expectedAccount])
->andReturn($deposit)->once();
// set new last transaction ID:
$lastPref = new Preference;
$lastPref->data =0;
Preferences::shouldReceive('getForUser')->withArgs([Mockery::any(), 'bunq-last-transaction-1234', 0])->andReturn($lastPref)->once();
$handler = new StageImportDataHandler;
$handler->setImportJob($job);
@@ -233,6 +238,11 @@ class StageImportDataHandlerTest extends TestCase
$accountRepository->shouldReceive('findNull')->withArgs([5678])->andReturn($account)->once();
$payment->shouldReceive('listing')->once()->andReturn($list);
// set new last transaction ID:
$lastPref = new Preference;
$lastPref->data =0;
Preferences::shouldReceive('getForUser')->withArgs([Mockery::any(), 'bunq-last-transaction-1234', 0])->andReturn($lastPref)->once();
$handler = new StageImportDataHandler;
$handler->setImportJob($job);
try {
@@ -279,6 +289,11 @@ class StageImportDataHandlerTest extends TestCase
$amount = new Amount('150', 'EUR');
$pointer = new Pointer('iban', 'ES2364265841767173822054', 'Test Site');
// set new last transaction ID:
$lastPref = new Preference;
$lastPref->data =0;
Preferences::shouldReceive('getForUser')->withArgs([Mockery::any(), 'bunq-last-transaction-1234', 0])->andReturn($lastPref)->once();
// ignore the deprecated fields:
$amount->setValue('150');
@@ -431,6 +446,11 @@ class StageImportDataHandlerTest extends TestCase
$value = [$payment];
$list = new BunqResponsePaymentList($value, [], null);
// set new last transaction ID:
$lastPref = new Preference;
$lastPref->data =0;
Preferences::shouldReceive('getForUser')->withArgs([Mockery::any(), 'bunq-last-transaction-1234', 0])->andReturn($lastPref)->once();
$expectedTransactions = [
[
'user' => 1,