mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-03 20:56:21 +00:00
Fix some tests for account API
This commit is contained in:
@@ -223,10 +223,6 @@ class Amount
|
||||
*/
|
||||
public function getAllCurrencies(): Collection
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
|
||||
return TransactionCurrency::orderBy('code', 'ASC')->get();
|
||||
}
|
||||
|
||||
@@ -235,10 +231,6 @@ class Amount
|
||||
*/
|
||||
public function getCurrencies(): Collection
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
|
||||
return TransactionCurrency::where('enabled', true)->orderBy('code', 'ASC')->get();
|
||||
}
|
||||
|
||||
@@ -247,9 +239,6 @@ class Amount
|
||||
*/
|
||||
public function getCurrencyCode(): string
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty('getCurrencyCode');
|
||||
if ($cache->has()) {
|
||||
@@ -273,9 +262,6 @@ class Amount
|
||||
*/
|
||||
public function getDefaultCurrency(): TransactionCurrency
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
@@ -287,10 +273,6 @@ class Amount
|
||||
*/
|
||||
public function getSystemCurrency(): TransactionCurrency
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
|
||||
return TransactionCurrency::where('code', 'EUR')->first();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@ class FireflyConfig
|
||||
*/
|
||||
public function delete(string $name): void
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s("%s") should NOT be called in the TEST environment!', __METHOD__, $name));
|
||||
}
|
||||
$fullName = 'ff-config-' . $name;
|
||||
if (Cache::has($fullName)) {
|
||||
Cache::forget($fullName);
|
||||
@@ -75,9 +72,6 @@ class FireflyConfig
|
||||
*/
|
||||
public function get(string $name, $default = null): ?Configuration
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s("%s") should NOT be called in the TEST environment!', __METHOD__, $name));
|
||||
}
|
||||
$fullName = 'ff-config-' . $name;
|
||||
if (Cache::has($fullName)) {
|
||||
return Cache::get($fullName);
|
||||
@@ -111,9 +105,7 @@ class FireflyConfig
|
||||
*/
|
||||
public function getFresh(string $name, $default = null): ?Configuration
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
|
||||
$config = Configuration::where('name', $name)->first(['id', 'name', 'data']);
|
||||
if ($config) {
|
||||
|
||||
@@ -135,9 +127,6 @@ class FireflyConfig
|
||||
*/
|
||||
public function put(string $name, $value): Configuration
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
|
||||
return $this->set($name, $value);
|
||||
}
|
||||
@@ -151,9 +140,6 @@ class FireflyConfig
|
||||
*/
|
||||
public function set(string $name, $value): Configuration
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
||||
}
|
||||
/** @var Configuration $config */
|
||||
try {
|
||||
$config = Configuration::whereName($name)->first();
|
||||
|
||||
@@ -62,9 +62,6 @@ class TransactionGroupTwig extends AbstractExtension
|
||||
return new TwigFunction(
|
||||
'journalGetMetaDate',
|
||||
static function (int $journalId, string $metaField) {
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning('Twig TransactionGroup::journalGetMetaDate should NOT be called in the TEST environment!');
|
||||
}
|
||||
$entry = DB::table('journal_meta')
|
||||
->where('name', $metaField)
|
||||
->where('transaction_journal_id', $journalId)
|
||||
@@ -87,9 +84,6 @@ class TransactionGroupTwig extends AbstractExtension
|
||||
return new TwigFunction(
|
||||
'journalGetMetaField',
|
||||
static function (int $journalId, string $metaField) {
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning('Twig TransactionGroup::journalGetMetaField should NOT be called in the TEST environment!');
|
||||
}
|
||||
$entry = DB::table('journal_meta')
|
||||
->where('name', $metaField)
|
||||
->where('transaction_journal_id', $journalId)
|
||||
|
||||
Reference in New Issue
Block a user