mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
Should fix tests.
This commit is contained in:
parent
a7f6848e53
commit
409ec2e086
@ -48,14 +48,10 @@ class AccountController extends Controller
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('all');
|
||||
$chartProperties->addProperty('accounts');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
|
||||
$chart->addColumn(trans('firefly.dayOfMonth'), 'date');
|
||||
@ -123,14 +119,10 @@ class AccountController extends Controller
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('frontpage');
|
||||
$chartProperties->addProperty('accounts');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
|
||||
$index = 1;
|
||||
@ -188,14 +180,10 @@ class AccountController extends Controller
|
||||
$chartProperties->addProperty('frontpage');
|
||||
$chartProperties->addProperty('single');
|
||||
$chartProperties->addProperty($account->id);
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
|
||||
|
||||
|
@ -44,13 +44,10 @@ class BillController extends Controller
|
||||
$chartProperties->addProperty('single');
|
||||
$chartProperties->addProperty('bill');
|
||||
$chartProperties->addProperty($bill->id);
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
// get first transaction or today for start:
|
||||
$results = $repository->getJournals($bill);
|
||||
@ -92,13 +89,10 @@ class BillController extends Controller
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('bills');
|
||||
$chartProperties->addProperty('frontpage');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
$bills = $repository->getActiveBills();
|
||||
$paid = new Collection; // journals.
|
||||
|
@ -50,13 +50,10 @@ class BudgetController extends Controller
|
||||
$chartProperties->addProperty($last);
|
||||
$chartProperties->addProperty('budget');
|
||||
$chartProperties->addProperty('budget');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
|
||||
while ($first < $last) {
|
||||
@ -100,13 +97,10 @@ class BudgetController extends Controller
|
||||
$chartProperties->addProperty('limit');
|
||||
$chartProperties->addProperty($budget->id);
|
||||
$chartProperties->addProperty($repetition->id);
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
$chart->addColumn(trans('firefly.day'), 'date');
|
||||
$chart->addColumn(trans('firefly.left'), 'number');
|
||||
@ -158,13 +152,10 @@ class BudgetController extends Controller
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('budget');
|
||||
$chartProperties->addProperty('all');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
|
||||
/** @var Budget $budget */
|
||||
@ -232,14 +223,10 @@ class BudgetController extends Controller
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('budget');
|
||||
$chartProperties->addProperty('year');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
// add columns:
|
||||
$chart->addColumn(trans('firefly.month'), 'date');
|
||||
|
@ -85,14 +85,10 @@ class CategoryController extends Controller
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('category');
|
||||
$chartProperties->addProperty('frontpage');
|
||||
$md5 = $chartProperties->md5();
|
||||
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached chart [' . $md5 . '].');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($chartProperties->has()) {
|
||||
return Response::json($chartProperties->get());
|
||||
}
|
||||
$md5 = $chartProperties->getMd5();
|
||||
|
||||
$set = $repository->getCategoriesAndExpensesCorrected($start, $end);
|
||||
|
||||
|
@ -41,16 +41,6 @@ class HomeController extends Controller
|
||||
{
|
||||
Session::clear();
|
||||
|
||||
// encrypt transaction journal description
|
||||
$set = TransactionJournal::where('encrypted', 0)->take(100)->get();
|
||||
/** @var TransactionJournal $entry */
|
||||
foreach ($set as $entry) {
|
||||
$description = $entry->description;
|
||||
$entry->description = $description;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $description);
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Response;
|
||||
use Session;
|
||||
use Steam;
|
||||
@ -44,12 +43,10 @@ class JsonController extends Controller
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-bills-paid');
|
||||
$md5 = $prop->md5();
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached box bills-paid [' . $md5 . ']');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($prop->has()) {
|
||||
return Response::json($prop->get());
|
||||
}
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
$amount = 0;
|
||||
|
||||
@ -100,12 +97,10 @@ class JsonController extends Controller
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-bills-unpaid');
|
||||
$md5 = $prop->md5();
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached box bills-unpaid [' . $md5 . ']');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($prop->has()) {
|
||||
return Response::json($prop->get());
|
||||
}
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
$bills = $repository->getActiveBills();
|
||||
$unpaid = new Collection; // bills
|
||||
@ -162,13 +157,10 @@ class JsonController extends Controller
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-in');
|
||||
$md5 = $prop->md5();
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached box in [' . $md5 . ']');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($prop->has()) {
|
||||
return Response::json($prop->get());
|
||||
}
|
||||
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
$amount = $reportQuery->incomeInPeriodCorrected($start, $end, true)->sum('amount');
|
||||
|
||||
@ -194,12 +186,10 @@ class JsonController extends Controller
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-out');
|
||||
$md5 = $prop->md5();
|
||||
if (Cache::has($md5)) {
|
||||
Log::debug('Successfully returned cached box out [' . $md5 . ']');
|
||||
|
||||
return Response::json(Cache::get($md5));
|
||||
if ($prop->has()) {
|
||||
return Response::json($prop->get());
|
||||
}
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
$amount = $reportQuery->expenseInPeriodCorrected($start, $end, true)->sum('amount');
|
||||
|
||||
|
@ -57,14 +57,13 @@ class Reminders
|
||||
$properties = new CacheProperties;
|
||||
|
||||
$properties->addProperty('reminders');
|
||||
$md5 = $properties->md5();
|
||||
|
||||
if (Cache::has($md5)) {
|
||||
$reminders = Cache::get($md5);
|
||||
if ($properties->has()) {
|
||||
$reminders = $properties->get();
|
||||
View::share('reminders', $reminders);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
$md5 = $properties->getMd5();
|
||||
|
||||
|
||||
$piggyBanks = $this->auth->user()->piggyBanks()->where('remind_me', 1)->get();
|
||||
|
@ -139,10 +139,10 @@ class TransactionJournal extends Model
|
||||
$prop = new CacheProperties();
|
||||
$prop->addProperty($this->id);
|
||||
$prop->addProperty('amount');
|
||||
$md5 = $prop->md5();
|
||||
if (Cache::has($md5)) {
|
||||
return Cache::get($md5);
|
||||
if ($prop->has()) {
|
||||
return $prop->get();
|
||||
}
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
|
||||
$amount = '0';
|
||||
|
@ -114,10 +114,10 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty($preference->data);
|
||||
$cache->addProperty('frontPageaccounts');
|
||||
$md5 = $cache->md5();
|
||||
if (Cache::has($md5)) {
|
||||
return Cache::get($md5);
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$md5 = $cache->getMd5();
|
||||
|
||||
|
||||
if ($preference->data == []) {
|
||||
@ -148,10 +148,10 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$prop->addProperty($account->id);
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$md5 = $prop->md5();
|
||||
if(Cache::has($md5)) {
|
||||
return Cache::get($md5);
|
||||
if ($prop->has()) {
|
||||
return $prop->get();
|
||||
}
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
$set = Auth::user()
|
||||
->transactionjournals()
|
||||
@ -167,6 +167,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
->take(10)
|
||||
->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']);
|
||||
Cache::forever($md5, $set);
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
||||
@ -234,10 +235,10 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($ids);
|
||||
$cache->addProperty('piggyAccounts');
|
||||
$md5 = $cache->md5();
|
||||
if (Cache::has($md5)) {
|
||||
return Cache::get($md5);
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$md5 = $cache->getMd5();
|
||||
|
||||
$ids = array_unique($ids);
|
||||
if (count($ids) > 0) {
|
||||
|
@ -4,6 +4,7 @@ namespace FireflyIII\Support;
|
||||
|
||||
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
|
||||
use Illuminate\Support\Collection;
|
||||
@ -17,6 +18,8 @@ use Preferences as Prefs;
|
||||
class CacheProperties
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
protected $md5 = '';
|
||||
/** @var Collection */
|
||||
protected $properties;
|
||||
|
||||
@ -38,39 +41,62 @@ class CacheProperties
|
||||
$this->properties->push($property);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
return Cache::get($this->md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function md5()
|
||||
public function getMd5()
|
||||
{
|
||||
return $this->md5;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function has()
|
||||
{
|
||||
$this->md5();
|
||||
|
||||
return Cache::has($this->md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function md5()
|
||||
{
|
||||
$string = '';
|
||||
//Log::debug('--- building string ---');
|
||||
foreach ($this->properties as $property) {
|
||||
|
||||
if ($property instanceof Collection || $property instanceof EloquentCollection) {
|
||||
$string .= print_r($property->toArray(), true);
|
||||
$this->md5 .= print_r($property->toArray(), true);
|
||||
continue;
|
||||
}
|
||||
if ($property instanceof Carbon) {
|
||||
$string .= $property->toRfc3339String();
|
||||
$this->md5 .= $property->toRfc3339String();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($property)) {
|
||||
$string .= print_r($property, true);
|
||||
$this->md5 .= print_r($property, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_object($property)) {
|
||||
$string .= $property->__toString();
|
||||
$this->md5 .= $property->__toString();
|
||||
}
|
||||
if (is_array($property)) {
|
||||
$string .= print_r($property, true);
|
||||
$this->md5 .= print_r($property, true);
|
||||
}
|
||||
$string .= (string)$property;
|
||||
$this->md5 .= (string)$property;
|
||||
}
|
||||
|
||||
return md5($string);
|
||||
$this->md5 = md5($this->md5);
|
||||
}
|
||||
}
|
@ -30,10 +30,10 @@ class Steam
|
||||
$properties->addProperty('balance');
|
||||
$properties->addProperty($date);
|
||||
$properties->addProperty($ignoreVirtualBalance);
|
||||
$md5 = $properties->md5();
|
||||
if (Cache::has($md5)) {
|
||||
return Cache::get($md5);
|
||||
if ($properties->has()) {
|
||||
return $properties->get();
|
||||
}
|
||||
$md5 = $properties->getMd5();
|
||||
|
||||
|
||||
// find the first known transaction on this account:
|
||||
|
@ -33,10 +33,10 @@ class Journal extends Twig_Extension
|
||||
$prop = new CacheProperties();
|
||||
$prop->addProperty($journal->id);
|
||||
$prop->addProperty('typeIcon');
|
||||
$md5 = $prop->md5();
|
||||
if (Cache::has($md5)) {
|
||||
return Cache::get($md5);
|
||||
if ($prop->has()) {
|
||||
return $prop->get();
|
||||
}
|
||||
$md5 = $prop->getMd5();
|
||||
|
||||
$type = $journal->transactionType->type;
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||
@ -79,6 +76,9 @@ class AccountControllerTest extends TestCase
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
$this->call('GET', '/accounts/create/asset');
|
||||
$this->assertResponseOk();
|
||||
|
@ -194,6 +194,9 @@ class BudgetControllerTest extends TestCase
|
||||
$date = Carbon::now()->startOfMonth()->format('FY');
|
||||
Preferences::shouldReceive('set')->once()->withArgs(['budgetIncomeTotal' . $date, 1001]);
|
||||
Preferences::shouldReceive('mark')->once()->andReturn(true);
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
@ -386,6 +389,9 @@ class BudgetControllerTest extends TestCase
|
||||
Amount::shouldReceive('format')->andReturn('xx');
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
|
@ -108,6 +108,10 @@ class HomeControllerTest extends TestCase
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('EUR');
|
||||
Amount::shouldReceive('format')->andReturn('xxx');
|
||||
|
@ -62,6 +62,10 @@ class PreferencesControllerTest extends TestCase
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn(new Collection);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
@ -105,6 +109,10 @@ class PreferencesControllerTest extends TestCase
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
|
||||
$this->call('POST', '/preferences', $data);
|
||||
$this->assertResponseStatus(302);
|
||||
|
@ -60,6 +60,14 @@ class ChartBillControllerTest extends TestCase
|
||||
$repository->shouldReceive('createFakeBill')->andReturn($bills->first());
|
||||
Steam::shouldReceive('balance')->andReturn(-10, 0);
|
||||
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
Preferences::shouldReceive('get')->withArgs(['language', 'en'])->andReturn($language);
|
||||
|
||||
|
||||
$this->call('GET', '/chart/bill/frontpage');
|
||||
$this->assertResponseOk();
|
||||
|
@ -111,6 +111,9 @@ class ReportHelperTest extends TestCase
|
||||
*/
|
||||
public function testGetBillReport()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
// factory!
|
||||
$set = new Collection;
|
||||
$journals = new Collection;
|
||||
|
@ -62,6 +62,8 @@ class TransactionJournalModelTest extends TestCase
|
||||
*/
|
||||
public function testGetAmountAttributeAdvancePayment()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
// make types:
|
||||
$withdrawalType = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$depositType = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
@ -120,6 +122,9 @@ class TransactionJournalModelTest extends TestCase
|
||||
*/
|
||||
public function testGetAmountAttributeBalancingAct()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
// make types:
|
||||
$withdrawalType = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
@ -177,6 +182,8 @@ class TransactionJournalModelTest extends TestCase
|
||||
*/
|
||||
public function testGetAmountAttributeNoTags()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
|
||||
$journal->transactions[0]->amount = 123.45;
|
||||
@ -194,6 +201,9 @@ class TransactionJournalModelTest extends TestCase
|
||||
*/
|
||||
public function testGetAmountAttributeTag()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
// has a normal tag, but nothing special.
|
||||
// make tag
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
|
@ -38,6 +38,9 @@ class BillRepositoryTest extends TestCase
|
||||
|
||||
public function testBillPaymentsInRange()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
$bill = FactoryMuffin::create('FireflyIII\Models\Bill');
|
||||
$start = Carbon::now()->startOfMonth();
|
||||
$end = Carbon::now()->endOfMonth();
|
||||
|
@ -446,6 +446,9 @@ class JournalRepositoryTest extends TestCase
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
}
|
||||
@ -504,6 +507,9 @@ class JournalRepositoryTest extends TestCase
|
||||
*/
|
||||
public function testUpdateNoTags()
|
||||
{
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user