Create some new test code.

This commit is contained in:
James Cole
2020-10-04 10:56:10 +02:00
parent a2eedb3742
commit 6671c6d45c
9 changed files with 271 additions and 32 deletions

View File

@@ -301,9 +301,6 @@ class Amount
*/
public function getDefaultCurrencyByUser(User $user): TransactionCurrency
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
}
$cache = new CacheProperties;
$cache->addProperty('getDefaultCurrency');
$cache->addProperty($user->id);
@@ -314,7 +311,7 @@ class Amount
$currencyPrefStr = $currencyPreference ? $currencyPreference->data : 'EUR';
// at this point the currency preference could be encrypted, if coming from an old version.
Log::debug('Going to try to decrypt users currency preference.');
//Log::debug('Going to try to decrypt users currency preference.');
$currencyCode = $this->tryDecrypt((string) $currencyPrefStr);
// could still be json encoded:
@@ -354,7 +351,7 @@ class Amount
try {
$value = Crypt::decrypt($value); // verified
} catch (DecryptException $e) {
Log::debug(sprintf('Could not decrypt "%s". %s', $value, $e->getMessage()));
//Log::debug(sprintf('Could not decrypt "%s". %s', $value, $e->getMessage()));
}
return $value;