mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Warn when classes are used in testing environment; this means tests aren't efficient.
This commit is contained in:
@@ -51,6 +51,11 @@ class BalanceReportHelper implements BalanceReportHelperInterface
|
||||
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
||||
{
|
||||
$this->budgetRepository = $budgetRepository;
|
||||
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class BudgetReportHelper.
|
||||
@@ -46,6 +47,11 @@ class BudgetReportHelper implements BudgetReportHelperInterface
|
||||
public function __construct(BudgetRepositoryInterface $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -48,6 +48,16 @@ class NetWorth implements NetWorthInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user's net worth in an array with the following layout:
|
||||
*
|
||||
|
@@ -30,7 +30,7 @@ use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* Class PopupReport.
|
||||
*
|
||||
@@ -38,6 +38,16 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class PopupReport implements PopupReportInterface
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect the tranactions for one account and one budget.
|
||||
*
|
||||
|
@@ -32,7 +32,7 @@ use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* Class ReportHelper.
|
||||
*
|
||||
@@ -52,6 +52,12 @@ class ReportHelper implements ReportHelperInterface
|
||||
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
||||
{
|
||||
$this->budgetRepository = $budgetRepository;
|
||||
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user