mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Warn when classes are used in testing environment; this means tests aren't efficient.
This commit is contained in:
@@ -25,6 +25,7 @@ namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Services\Internal\Support\AccountServiceTrait;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class AccountUpdateService
|
||||
@@ -32,7 +33,15 @@ use FireflyIII\Services\Internal\Support\AccountServiceTrait;
|
||||
class AccountUpdateService
|
||||
{
|
||||
use AccountServiceTrait;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update account data.
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Services\Internal\Support\BillServiceTrait;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Class BillUpdateService
|
||||
@@ -34,6 +34,16 @@ class BillUpdateService
|
||||
{
|
||||
use BillServiceTrait;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param array $data
|
||||
|
||||
@@ -24,13 +24,23 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Models\Category;
|
||||
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class CategoryUpdateService
|
||||
*/
|
||||
class CategoryUpdateService
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
* @param array $data
|
||||
|
||||
@@ -24,12 +24,22 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* Class CurrencyUpdateService
|
||||
*/
|
||||
class CurrencyUpdateService
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
* @param array $data
|
||||
|
||||
@@ -30,7 +30,6 @@ use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Services\Internal\Support\JournalServiceTrait;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class to centralise code that updates a journal given the input by system.
|
||||
*
|
||||
@@ -39,6 +38,16 @@ use Log;
|
||||
class JournalUpdateService
|
||||
{
|
||||
use JournalServiceTrait;
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace FireflyIII\Services\Internal\Update;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Services\Internal\Support\TransactionServiceTrait;
|
||||
use FireflyIII\User;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* Class TransactionUpdateService
|
||||
*/
|
||||
@@ -34,6 +34,16 @@ class TransactionUpdateService
|
||||
{
|
||||
use TransactionServiceTrait;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === env('APP_ENV')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user