mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Updated some tests.
This commit is contained in:
parent
99d4adf5e6
commit
9e050fb059
@ -70,7 +70,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
if ($account->accountType->type != 'Cash account') {
|
if ($account->accountType->type != 'Cash account') {
|
||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
}
|
} // @codeCoverageIgnore
|
||||||
);
|
);
|
||||||
|
|
||||||
// summarize:
|
// summarize:
|
||||||
|
@ -6,6 +6,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use Input;
|
use Input;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
|
use Route;
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
|
|
||||||
@ -87,5 +88,78 @@ class HomeController extends Controller
|
|||||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));
|
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
|
*/
|
||||||
|
public function routes()
|
||||||
|
{
|
||||||
|
$directory = '/vagrant_data/Sites/firefly-iii-help';
|
||||||
|
$languages = array_keys(Config::get('firefly.lang'));
|
||||||
|
$routes = [];
|
||||||
|
$ignored = [
|
||||||
|
'debugbar.openhandler', 'debugbar.assets.css', 'debugbar.assets.js', 'register', 'routes', 'daterange',
|
||||||
|
'flush', 'delete-account-post', 'change-password-post', 'logout', 'login', 'tags.hideTagHelp',
|
||||||
|
'budgets.postIncome', 'flush'
|
||||||
|
];
|
||||||
|
|
||||||
|
$ignoreMatch = ['.store', '.update', '.destroy', 'json.'];
|
||||||
|
|
||||||
|
$routeCollection = Route::getRoutes();
|
||||||
|
/** @var \Illuminate\Routing\Route $object */
|
||||||
|
foreach ($routeCollection as $object) {
|
||||||
|
// get name:
|
||||||
|
$name = $object->getName();
|
||||||
|
// has name and not in ignore list?
|
||||||
|
if (strlen($name) > 0 && !in_array($name, $ignored)) {
|
||||||
|
|
||||||
|
// not in ignoreMatch?
|
||||||
|
$continue = true;
|
||||||
|
foreach ($ignoreMatch as $ignore) {
|
||||||
|
$match = strpos($name, $ignore);
|
||||||
|
if (!($match === false)) {
|
||||||
|
$continue = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($ignore, $match);
|
||||||
|
|
||||||
|
if ($continue) {
|
||||||
|
|
||||||
|
$routes[] = $name;
|
||||||
|
|
||||||
|
// check all languages:
|
||||||
|
foreach ($languages as $lang) {
|
||||||
|
$file = $directory . '/' . $lang . '/' . $name . '.md';
|
||||||
|
if (!file_exists($file)) {
|
||||||
|
touch($file);
|
||||||
|
echo $name . '<br />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// loop directories with language file.
|
||||||
|
// tag the ones not in the list of approved routes.
|
||||||
|
foreach ($languages as $lang) {
|
||||||
|
$dir = $directory . '/' . $lang;
|
||||||
|
$set = scandir($dir);
|
||||||
|
foreach ($set as $entry) {
|
||||||
|
if ($entry != '.' && $entry != '..') {
|
||||||
|
$name = str_replace('.md', '', $entry);
|
||||||
|
if (!in_array($name, $routes)) {
|
||||||
|
$file = $dir . '/' . $entry;
|
||||||
|
unlink($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo 'Done!';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -193,6 +193,7 @@ Route::controllers(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Route::get('/routes', ['uses' => 'HomeController@routes', 'as' => 'routes']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Home Controller
|
* Home Controller
|
||||||
|
@ -18,6 +18,7 @@ class Account extends Model
|
|||||||
use SoftDeletes, ValidatingTrait;
|
use SoftDeletes, ValidatingTrait;
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance'];
|
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance'];
|
||||||
|
protected $hidden = ['virtual_balance_encrypted', 'encrypted'];
|
||||||
protected $rules
|
protected $rules
|
||||||
= [
|
= [
|
||||||
'user_id' => 'required|exists:users,id',
|
'user_id' => 'required|exists:users,id',
|
||||||
@ -116,6 +117,7 @@ class Account extends Model
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param $fieldName
|
* @param $fieldName
|
||||||
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
@ -151,7 +153,7 @@ class Account extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
* @codeCoverageIgnore
|
||||||
* @return float|int
|
* @return float|int
|
||||||
*/
|
*/
|
||||||
public function getVirtualBalanceAttribute($value)
|
public function getVirtualBalanceAttribute($value)
|
||||||
@ -220,6 +222,7 @@ class Account extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function setVirtualBalanceAttribute($value)
|
public function setVirtualBalanceAttribute($value)
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,7 @@ use Crypt;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Bill
|
* Class Bill
|
||||||
*
|
*
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
@ -14,6 +15,8 @@ class Bill extends Model
|
|||||||
protected $fillable
|
protected $fillable
|
||||||
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',];
|
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',];
|
||||||
|
|
||||||
|
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -31,6 +34,7 @@ class Bill extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return float|int
|
* @return float|int
|
||||||
@ -66,9 +70,7 @@ class Bill extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
return $value;
|
return $value;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,9 +85,7 @@ class Bill extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
return $value;
|
return $value;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,8 @@ class Budget extends Model
|
|||||||
|
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'name'];
|
protected $fillable = ['user_id', 'name', 'active'];
|
||||||
|
protected $hidden = ['encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -46,9 +47,7 @@ class Budget extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
return $value;
|
return $value;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,6 +12,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class BudgetLimit extends Model
|
class BudgetLimit extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $hidden = ['amount_encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
|
@ -16,24 +16,7 @@ class Category extends Model
|
|||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'name'];
|
protected $fillable = ['user_id', 'name'];
|
||||||
|
protected $hidden = ['encrypted'];
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
|
||||||
*/
|
|
||||||
public function transactionjournals()
|
|
||||||
{
|
|
||||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
@ -71,22 +54,11 @@ class Category extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
|
||||||
* @param $value
|
|
||||||
*/
|
|
||||||
public function setNameAttribute($value)
|
|
||||||
{
|
|
||||||
$this->attributes['name'] = Crypt::encrypt($value);
|
|
||||||
$this->attributes['encrypted'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,4 +78,33 @@ class Category extends Model
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
|
* @param $value
|
||||||
|
*/
|
||||||
|
public function setNameAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['name'] = Crypt::encrypt($value);
|
||||||
|
$this->attributes['encrypted'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
|
public function transactionjournals()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
<?php namespace FireflyIII\Models;
|
<?php namespace FireflyIII\Models;
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use Crypt;
|
use Crypt;
|
||||||
use DB;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class LimitRepetition
|
* Class LimitRepetition
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class LimitRepetition extends Model
|
class LimitRepetition extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $hidden = ['amount_encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function budgetLimit()
|
public function budgetLimit()
|
||||||
@ -22,15 +23,6 @@ class LimitRepetition extends Model
|
|||||||
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -47,6 +39,14 @@ class LimitRepetition extends Model
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getDates()
|
||||||
|
{
|
||||||
|
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBank
|
* Class PiggyBank
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class PiggyBank extends Model
|
class PiggyBank extends Model
|
||||||
@ -14,10 +16,10 @@ class PiggyBank extends Model
|
|||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
protected $fillable
|
protected $fillable
|
||||||
= ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
|
= ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
|
||||||
|
protected $hidden = ['targetamount_encrypted', 'encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function account()
|
public function account()
|
||||||
@ -45,7 +47,6 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function piggyBankRepetitions()
|
public function piggyBankRepetitions()
|
||||||
@ -54,7 +55,6 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@ -63,7 +63,6 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -76,13 +75,10 @@ class PiggyBank extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
return $value;
|
return $value;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -110,7 +106,6 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function piggyBankEvents()
|
public function piggyBankEvents()
|
||||||
@ -119,7 +114,6 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
*/
|
*/
|
||||||
public function reminders()
|
public function reminders()
|
||||||
@ -128,7 +122,6 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
|
@ -7,12 +7,14 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* Class PiggyBankEvent
|
* Class PiggyBankEvent
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class PiggyBankEvent extends Model
|
class PiggyBankEvent extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
|
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
|
||||||
|
protected $hidden = ['amount_encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
|
@ -15,6 +15,7 @@ class PiggyBankRepetition extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
|
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
|
||||||
|
protected $hidden = ['currentamount_encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -13,6 +13,7 @@ class Preference extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'data', 'name'];
|
protected $fillable = ['user_id', 'data', 'name'];
|
||||||
|
protected $hidden = ['data_encrypted', 'name_encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
|
@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class Reminder
|
* Class Reminder
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class Reminder extends Model
|
class Reminder extends Model
|
||||||
@ -15,9 +17,9 @@ class Reminder extends Model
|
|||||||
|
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'startdate', 'metadata', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',];
|
protected $fillable = ['user_id', 'startdate', 'metadata', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',];
|
||||||
|
protected $hidden = ['encrypted'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -29,7 +31,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@ -38,7 +39,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -54,7 +54,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -66,7 +65,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||||
*/
|
*/
|
||||||
public function remindersable()
|
public function remindersable()
|
||||||
@ -75,7 +73,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
@ -89,7 +86,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
*
|
*
|
||||||
@ -104,7 +100,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
@ -115,7 +110,6 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
|
@ -17,6 +17,7 @@ class Transaction extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount'];
|
protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount'];
|
||||||
|
protected $hidden = ['encrypted'];
|
||||||
protected $rules
|
protected $rules
|
||||||
= [
|
= [
|
||||||
'account_id' => 'required|exists:accounts,id',
|
'account_id' => 'required|exists:accounts,id',
|
||||||
|
@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,9 +18,9 @@ class TransactionJournal extends Model
|
|||||||
use SoftDeletes, ValidatingTrait;
|
use SoftDeletes, ValidatingTrait;
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'transaction_type_id', 'bill_id', 'transaction_currency_id', 'description', 'completed', 'date', 'encrypted'];
|
protected $fillable = ['user_id', 'transaction_type_id', 'bill_id', 'transaction_currency_id', 'description', 'completed', 'date', 'encrypted'];
|
||||||
|
protected $hidden = ['encrypted'];
|
||||||
protected $rules
|
protected $rules
|
||||||
= [
|
= [
|
||||||
'user_id' => 'required|exists:users,id',
|
'user_id' => 'required|exists:users,id',
|
||||||
'transaction_type_id' => 'required|exists:transaction_types,id',
|
'transaction_type_id' => 'required|exists:transaction_types,id',
|
||||||
'bill_id' => 'exists:bills,id',
|
'bill_id' => 'exists:bills,id',
|
||||||
|
@ -145,6 +145,7 @@ class CategoryControllerTest extends TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testStore()
|
public function testStore()
|
||||||
{
|
{
|
||||||
// create
|
// create
|
||||||
|
@ -231,6 +231,8 @@ class TransactionControllerTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
* @covers FireflyIII\Models\Category::firstOrCreateEncrypted
|
||||||
|
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||||
*/
|
*/
|
||||||
public function testStore()
|
public function testStore()
|
||||||
{
|
{
|
||||||
@ -254,7 +256,7 @@ class TransactionControllerTest extends TestCase
|
|||||||
'budget_id' => '0',
|
'budget_id' => '0',
|
||||||
'create_another' => '1',
|
'create_another' => '1',
|
||||||
'category' => '',
|
'category' => '',
|
||||||
'tags' => '',
|
'tags' => 'fat-test',
|
||||||
'piggy_bank_id' => '0',
|
'piggy_bank_id' => '0',
|
||||||
'_token' => 'replaceMe',
|
'_token' => 'replaceMe',
|
||||||
];
|
];
|
||||||
@ -277,6 +279,8 @@ class TransactionControllerTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
* @covers FireflyIII\Models\Category::firstOrCreateEncrypted
|
||||||
|
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||||
*/
|
*/
|
||||||
public function testStoreTransfer()
|
public function testStoreTransfer()
|
||||||
{
|
{
|
||||||
@ -314,7 +318,7 @@ class TransactionControllerTest extends TestCase
|
|||||||
'budget_id' => '0',
|
'budget_id' => '0',
|
||||||
'create_another' => '1',
|
'create_another' => '1',
|
||||||
'category' => '',
|
'category' => '',
|
||||||
'tags' => '',
|
'tags' => 'fat-test',
|
||||||
'piggy_bank_id' => $piggy->id,
|
'piggy_bank_id' => $piggy->id,
|
||||||
'_token' => 'replaceMe',
|
'_token' => 'replaceMe',
|
||||||
];
|
];
|
||||||
@ -337,6 +341,8 @@ class TransactionControllerTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
* @covers FireflyIII\Models\Category::firstOrCreateEncrypted
|
||||||
|
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||||
*/
|
*/
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
@ -362,7 +368,7 @@ class TransactionControllerTest extends TestCase
|
|||||||
'date' => '2015-05-31',
|
'date' => '2015-05-31',
|
||||||
'budget_id' => '0',
|
'budget_id' => '0',
|
||||||
'category' => 'Lunch',
|
'category' => 'Lunch',
|
||||||
'tags' => '',
|
'tags' => 'fat-test',
|
||||||
'piggy_bank_id' => '0',
|
'piggy_bank_id' => '0',
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -385,6 +391,8 @@ class TransactionControllerTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
* @covers FireflyIII\Models\Category::firstOrCreateEncrypted
|
||||||
|
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||||
*/
|
*/
|
||||||
public function testUpdateWithRedirect()
|
public function testUpdateWithRedirect()
|
||||||
{
|
{
|
||||||
@ -411,7 +419,7 @@ class TransactionControllerTest extends TestCase
|
|||||||
'budget_id' => '0',
|
'budget_id' => '0',
|
||||||
'category' => 'Lunch',
|
'category' => 'Lunch',
|
||||||
'return_to_edit' => 1,
|
'return_to_edit' => 1,
|
||||||
'tags' => '',
|
'tags' => 'fat-test',
|
||||||
'piggy_bank_id' => '0',
|
'piggy_bank_id' => '0',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -611,6 +611,7 @@ class AccountRepositoryTest extends TestCase
|
|||||||
* @covers FireflyIII\Repositories\Account\AccountRepository::storeAccount
|
* @covers FireflyIII\Repositories\Account\AccountRepository::storeAccount
|
||||||
* @covers FireflyIII\Repositories\Account\AccountRepository::storeMetadata
|
* @covers FireflyIII\Repositories\Account\AccountRepository::storeMetadata
|
||||||
* @covers FireflyIII\Repositories\Account\AccountRepository::storeInitialBalance
|
* @covers FireflyIII\Repositories\Account\AccountRepository::storeInitialBalance
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function testStore()
|
public function testStore()
|
||||||
{
|
{
|
||||||
@ -686,6 +687,7 @@ class AccountRepositoryTest extends TestCase
|
|||||||
* @covers FireflyIII\Repositories\Account\AccountRepository::storeAccount
|
* @covers FireflyIII\Repositories\Account\AccountRepository::storeAccount
|
||||||
* @covers FireflyIII\Repositories\Account\AccountRepository::storeMetadata
|
* @covers FireflyIII\Repositories\Account\AccountRepository::storeMetadata
|
||||||
* @covers FireflyIII\Repositories\Account\AccountRepository::storeInitialBalance
|
* @covers FireflyIII\Repositories\Account\AccountRepository::storeInitialBalance
|
||||||
|
* @covers FireflyII\Models\Account::firstOrNullEncrypted
|
||||||
* @expectedException Symfony\Component\HttpKernel\Exception\HttpException
|
* @expectedException Symfony\Component\HttpKernel\Exception\HttpException
|
||||||
*/
|
*/
|
||||||
public function testStoreWithInvalidAccountData()
|
public function testStoreWithInvalidAccountData()
|
||||||
|
Loading…
Reference in New Issue
Block a user