mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 19:01:39 +00:00
Fixed tests.
This commit is contained in:
@@ -12,7 +12,7 @@ use Session;
|
||||
use Steam;
|
||||
use URL;
|
||||
use View;
|
||||
|
||||
use Preferences;
|
||||
/**
|
||||
* Class AccountController
|
||||
*
|
||||
|
@@ -363,11 +363,11 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
if ($data['openingBalance'] != 0) {
|
||||
$type = $data['openingBalance'] < 0 ? 'expense' : 'revenue';
|
||||
$opposingData = [
|
||||
'user' => $data['user'],
|
||||
'accountType' => $type,
|
||||
'user' => $data['user'],
|
||||
'accountType' => $type,
|
||||
'virtualBalance' => 0,
|
||||
'name' => $data['name'] . ' initial balance',
|
||||
'active' => false,
|
||||
'name' => $data['name'] . ' initial balance',
|
||||
'active' => false,
|
||||
];
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
$this->storeInitialBalance($newAccount, $opposing, $data);
|
||||
@@ -414,10 +414,11 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
// create new opening balance.
|
||||
$type = $data['openingBalance'] < 0 ? 'expense' : 'revenue';
|
||||
$opposingData = [
|
||||
'user' => $data['user'],
|
||||
'accountType' => $type,
|
||||
'name' => $data['name'] . ' initial balance',
|
||||
'active' => false,
|
||||
'user' => $data['user'],
|
||||
'accountType' => $type,
|
||||
'name' => $data['name'] . ' initial balance',
|
||||
'active' => false,
|
||||
'virtualBalance' => 0,
|
||||
];
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
$this->storeInitialBalance($account, $opposing, $data);
|
||||
|
@@ -7,7 +7,7 @@ use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
|
||||
use Illuminate\Support\Collection;
|
||||
use Preferences;
|
||||
use Preferences as Prefs;
|
||||
|
||||
/**
|
||||
* Class ChartProperties
|
||||
@@ -27,7 +27,7 @@ class ChartProperties
|
||||
{
|
||||
$this->properties = new Collection;
|
||||
$this->addProperty(Auth::user()->id);
|
||||
$this->addProperty(Preferences::lastActivity());
|
||||
$this->addProperty(Prefs::lastActivity());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,28 +50,21 @@ class ChartProperties
|
||||
|
||||
if ($property instanceof Collection || $property instanceof EloquentCollection) {
|
||||
$string .= print_r($property->toArray(), true);
|
||||
// Log::debug('added collection (size=' . $property->count() . ')');
|
||||
continue;
|
||||
}
|
||||
if ($property instanceof Carbon) {
|
||||
$string .= $property->toRfc3339String();
|
||||
// Log::debug('Added time: ' . $property->toRfc3339String());
|
||||
continue;
|
||||
}
|
||||
if (is_object($property)) {
|
||||
$string .= $property->__toString();
|
||||
// Log::debug('Added object of class ' . get_class($property));
|
||||
}
|
||||
if (is_array($property)) {
|
||||
$string .= print_r($property, true);
|
||||
// Log::debug('Added array (size=' . count($property) . ')');
|
||||
}
|
||||
$string .= (string)$property;
|
||||
// Log::debug('Added cast to string: ' . $property);
|
||||
}
|
||||
|
||||
// Log::debug('--- done building string ---');
|
||||
|
||||
return md5($string);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user