Expand tests.

This commit is contained in:
James Cole
2017-03-17 16:34:57 +01:00
parent fd1f06c2cb
commit e2f3788ff5
9 changed files with 63 additions and 5 deletions

View File

@@ -438,8 +438,9 @@ class CategoryController extends Controller
return $cache->get(); // @codeCoverageIgnore
}
Log::debug('Going to get period expenses and incomes.');
Log::debug(sprintf('Going to get period expenses and incomes between %s and %s.', $start->format('Y-m-d'), $end->format('Y-m-d')));
while ($end >= $start) {
Log::debug('Loop!');
$end = Navigation::startOfPeriod($end, $range);
$currentEnd = Navigation::endOfPeriod($end, $range);
@@ -483,6 +484,7 @@ class CategoryController extends Controller
);
$end = Navigation::subtractPeriod($end, $range, 1);
}
Log::debug('End of loops');
$cache->store($entries);
return $entries;

View File

@@ -229,7 +229,8 @@ class PiggyBankController extends Controller
'sumOfTargets' => $piggyBank->targetamount,
'leftToSave' => $piggyBank->leftToSave,
];
} else {
}
if (isset($accounts[$account->id])) {
$accounts[$account->id]['sumOfSaved'] = bcadd($accounts[$account->id]['sumOfSaved'], strval($piggyBank->savedSoFar));
$accounts[$account->id]['sumOfTargets'] = bcadd($accounts[$account->id]['sumOfTargets'], $piggyBank->targetamount);
$accounts[$account->id]['leftToSave'] = bcadd($accounts[$account->id]['leftToSave'], $piggyBank->leftToSave);

View File

@@ -212,11 +212,12 @@ class TransactionController extends Controller
$cache->addProperty('transaction-list-entries');
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
return $cache->get(); // @codeCoverageIgnore
}
Log::debug('Going to get period expenses and incomes.');
Log::debug(sprintf('Going to get period expenses and incomes between %s and %s.', $start->format('Y-m-d'), $end->format('Y-m-d')));
while ($end >= $start) {
Log::debug('Loop start!');
$end = Navigation::startOfPeriod($end, $range);
$currentEnd = Navigation::endOfPeriod($end, $range);
@@ -238,6 +239,7 @@ class TransactionController extends Controller
'transferred' => 0,
'date' => clone $end,
];
Log::debug(sprintf('What is %s', $what));
switch ($what) {
default:
throw new FireflyException(sprintf('Cannot handle "%s"', $what));
@@ -249,6 +251,7 @@ class TransactionController extends Controller
break;
case 'transfers':
case 'transfer':
Log::debug('HERE');
$array['transferred'] = Steam::positive($sum);
break;
@@ -256,6 +259,7 @@ class TransactionController extends Controller
$entries->push($array);
$end = Navigation::subtractPeriod($end, $range, 1);
}
Log::debug('End of loop');
$cache->store($entries);
return $entries;