Skip to content

Firefly III: a personal finances manager

Fix tests, remove some logging.

James Cole8a0010147089
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index 8294a53021..fa2ae5e236 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -53,7 +53,6 @@ class Amount
{
$locale = explode(',', trans('config.locale'));
$locale = array_map('trim', $locale);
- Log::debug('formatAnything(). Will set locale to', $locale);
setlocale(LC_MONETARY, $locale);
$float = round($amount, 12);
$info = localeconv();
diff --git a/tests/acceptance/Controllers/BudgetControllerTest.php b/tests/acceptance/Controllers/BudgetControllerTest.php
index 2057ce68f8..25f0f3b91a 100644
--- a/tests/acceptance/Controllers/BudgetControllerTest.php
+++ b/tests/acceptance/Controllers/BudgetControllerTest.php
@@ -215,6 +215,7 @@ class BudgetControllerTest extends TestCase
// mock budget repository
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
$budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
+ $budgetRepository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
// mock journal collector:
$collector = $this->mock(JournalCollectorInterface::class);
diff --git a/tests/acceptance/Controllers/CategoryControllerTest.php b/tests/acceptance/Controllers/CategoryControllerTest.php
index 3b546635d3..da294075d4 100644
--- a/tests/acceptance/Controllers/CategoryControllerTest.php
+++ b/tests/acceptance/Controllers/CategoryControllerTest.php
@@ -193,6 +193,12 @@ class CategoryControllerTest extends TestCase
$collector->shouldReceive('setCategory')->andReturnSelf()->once();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
+ // mock category repository
+ $repository = $this->mock(CategoryRepositoryInterface::class);
+ $repository->shouldReceive('firstUseDate')->once()->andReturn(new Carbon);
+ $repository->shouldReceive('spentInPeriod')->andReturn('-1');
+ $repository->shouldReceive('earnedInPeriod')->andReturn('1');
+
$this->be($this->user());
$this->changeDateRange($this->user(), $range);