Fixed tests.

This commit is contained in:
James Cole
2015-06-02 17:58:30 +02:00
parent 71947c097f
commit 616c849b1f
7 changed files with 16 additions and 18 deletions

View File

@@ -12,7 +12,7 @@ use Session;
use Steam;
use URL;
use View;
use Preferences;
/**
* Class AccountController
*

View File

@@ -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);

View File

@@ -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);
}
}