Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Code cleanup.
James Cole781ca052d8dc
diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.phpindex 9e662ae441..a15b78de80 100644--- a/app/Http/Controllers/Account/ReconcileController.php+++ b/app/Http/Controllers/Account/ReconcileController.php@@ -70,11 +70,12 @@ class ReconcileController extends Controller* @param Carbon $end** @return \Illuminate\Http\JsonResponse+ ** @throws FireflyException*/public function overview(Request $request, Account $account, Carbon $start, Carbon $end){- if ($account->accountType->type !== AccountType::ASSET) {+ if (AccountType::ASSET !== $account->accountType->type) {throw new FireflyException(sprintf('Account %s is not an asset account.', $account->name));}$startBalance = $request->get('startBalance');@@ -102,7 +103,7 @@ class ReconcileController extends Controllerforeach ($cleared as $transaction) {if ($transaction->transactionJournal->date <= $end) {$clearedAmount = bcadd($clearedAmount, $transaction->amount);- $countCleared++;+ ++$countCleared;}}@@ -120,7 +121,7 @@ class ReconcileController extends Controller'accounts.reconcile.overview',compact('account', 'start', 'diffCompare', 'difference', 'end', 'clearedIds', 'transactionIds', 'clearedAmount', 'startBalance', 'endBalance', 'amount',- 'route','countCleared'+ 'route', 'countCleared'))->render();@@ -212,7 +213,7 @@ class ReconcileController extends Controller}// create reconciliation transaction (if necessary):- if ($request->get('reconcile') === 'create') {+ if ('create' === $request->get('reconcile')) {/** @var AccountRepositoryInterface $accountRepos */$accountRepos = app(AccountRepositoryInterface::class);$reconciliation = $accountRepos->getReconciliation($account);@@ -243,8 +244,6 @@ class ReconcileController extends ControllerSession::flash('success', trans('firefly.reconciliation_stored'));return redirect(route('accounts.show', [$account->id]));--}/**diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.phpindex 94da2b319f..cd5f5aa58a 100644--- a/app/Http/Controllers/Auth/LoginController.php+++ b/app/Http/Controllers/Auth/LoginController.php@@ -74,7 +74,7 @@ class LoginController extends Controller/*** Handle a login request to the application.*- * @param \Illuminate\Http\Request $request+ * @param \Illuminate\Http\Request $request** @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse*/@@ -92,7 +92,6 @@ class LoginController extends Controller}if ($this->attemptLogin($request)) {-// user is logged in. Save in session if the user requested session to be remembered:$request->session()->put('remember_login', $request->filled('remember'));@@ -110,7 +109,8 @@ class LoginController extends Controller/*** Log the user out of the application.*- * @param \Illuminate\Http\Request $request+ * @param \Illuminate\Http\Request $request+ ** @return \Illuminate\Http\Response*/public function logout(Request $request, CookieJar $cookieJar)@@ -166,7 +166,6 @@ class LoginController extends Controller$email = $request->old('email');$remember = $request->old('remember');-- return view('auth.login', compact('allowRegistration', 'email', 'remember'));//->withCookie($cookie);+ return view('auth.login', compact('allowRegistration', 'email', 'remember')); //->withCookie($cookie);}}diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.phpindex de2da698d8..a4cd2711de 100644--- a/app/Http/Controllers/Auth/TwoFactorController.php+++ b/app/Http/Controllers/Auth/TwoFactorController.php@@ -74,9 +74,9 @@ class TwoFactorController extends Controller*/public function lostTwoFactor(){- $user = auth()->user();+ $user = auth()->user();$siteOwner = env('SITE_OWNER', '');- $title = strval(trans('firefly.two_factor_forgot_title'));+ $title = strval(trans('firefly.two_factor_forgot_title'));Log::info('To reset the two factor authentication for user #' . $user->id .@@ -99,10 +99,8 @@ class TwoFactorController extends Controller// wants to remember session?$remember = $request->session()->get('remember_login') ?? false;--- $minutes = config('session.lifetime');- if ($remember === true) {+ $minutes = config('session.lifetime');+ if (true === $remember) {// set cookie with a long lifetime (30 days)$minutes = 43200;}diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.phpindex 648185d382..840ac16ab1 100644--- a/app/Http/Middleware/AuthenticateTwoFactor.php+++ b/app/Http/Middleware/AuthenticateTwoFactor.php@@ -23,7 +23,6 @@ declare(strict_types=1);namespace FireflyIII\Http\Middleware;use Closure;-use Cookie;use Illuminate\Http\Request;use Illuminate\Support\Facades\Auth;use Log;diff --git a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.phpindex 5e43aa7837..dce366ed4c 100644--- a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php+++ b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php@@ -23,7 +23,6 @@ declare(strict_types=1);namespace FireflyIII\Http\Middleware;use Closure;-use Cookie;use Illuminate\Support\Facades\Auth;use Preferences;diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.phpindex f5e6420963..0977ccba88 100644--- a/app/Import/Converter/Amount.php+++ b/app/Import/Converter/Amount.php@@ -88,7 +88,8 @@ class Amount implements ConverterInterfaceLog::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $oldValue, $value));}- $number = strval(number_format(round(floatval($value), 12), 12,'.',''));+ $number = strval(number_format(round(floatval($value), 12), 12, '.', ''));+return $number;}}diff --git a/app/Import/Object/ImportJournal.php b/app/Import/Object/ImportJournal.phpindex 3f27e1ab49..299315b47f 100644--- a/app/Import/Object/ImportJournal.php+++ b/app/Import/Object/ImportJournal.php@@ -24,7 +24,6 @@ namespace FireflyIII\Import\Object;use Carbon\Carbon;use FireflyIII\Exceptions\FireflyException;-use FireflyIII\Import\Converter\Amount;use FireflyIII\Import\Converter\ConverterInterface;use FireflyIII\Import\MapperPreProcess\PreProcessorInterface;use FireflyIII\User;@@ -131,7 +130,7 @@ class ImportJournal$converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amountCredit['role'])));$info = $this->amountCredit;}- if (count($info) === 0) {+ if (0 === count($info)) {throw new FireflyException('No amount information for this row.');}diff --git a/app/Repositories/Account/FindAccountsTrait.php b/app/Repositories/Account/FindAccountsTrait.phpindex b8609b7990..6910dad202 100644--- a/app/Repositories/Account/FindAccountsTrait.php+++ b/app/Repositories/Account/FindAccountsTrait.php@@ -228,11 +228,12 @@ trait FindAccountsTrait* @param Account $account** @return Account|null+ ** @throws FireflyException*/public function getReconciliation(Account $account): ?Account{- if ($account->accountType->type !== AccountType::ASSET) {+ if (AccountType::ASSET !== $account->accountType->type) {throw new FireflyException(sprintf('%s is not an asset account.', $account->name));}$name = $account->name . ' reconciliation';diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.phpindex 57700ad52d..3a87a8f602 100644--- a/app/Repositories/Journal/JournalRepository.php+++ b/app/Repositories/Journal/JournalRepository.php@@ -189,7 +189,7 @@ class JournalRepository implements JournalRepositoryInterface->where('transaction_journals.user_id', $this->user->id)->whereNull('transaction_journals.deleted_at')->whereNull('transactions.deleted_at')- ->get( ['transactions.*']);+ ->get(['transactions.*']);return $set;}diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.phpindex 694683e2f0..2afb7a2785 100644--- a/app/Repositories/Journal/JournalRepositoryInterface.php+++ b/app/Repositories/Journal/JournalRepositoryInterface.php@@ -35,15 +35,6 @@ use Illuminate\Support\MessageBag;*/interface JournalRepositoryInterface{-- /**- * @param array $transactionIds- *- * @return Collection- */- public function getTransactionsById(array $transactionIds): Collection;--/*** @param TransactionJournal $journal* @param TransactionType $type@@ -105,6 +96,13 @@ interface JournalRepositoryInterface*/public function getTransactionTypes(): Collection;+ /**+ * @param array $transactionIds+ *+ * @return Collection+ */+ public function getTransactionsById(array $transactionIds): Collection;+/*** @param TransactionJournal $journal*diff --git a/app/Support/Import/Configuration/Csv/Roles.php b/app/Support/Import/Configuration/Csv/Roles.phpindex e15b2cf898..97160b430e 100644--- a/app/Support/Import/Configuration/Csv/Roles.php+++ b/app/Support/Import/Configuration/Csv/Roles.php@@ -258,7 +258,7 @@ class Roles implements ConfigurationInterfaceif ('_ignore' !== $role) {++$assigned;}- if (in_array($role, ['amount','amount_credit','amount_debet'])) {+ if (in_array($role, ['amount', 'amount_credit', 'amount_debet'])) {$hasAmount = true;}}diff --git a/app/Support/Preferences.php b/app/Support/Preferences.phpindex 9acfcad9ce..d7aeec3970 100644--- a/app/Support/Preferences.php+++ b/app/Support/Preferences.php@@ -127,7 +127,6 @@ class Preferences{$fullName = sprintf('preference%s%s', $user->id, $name);if (Cache::has($fullName)) {-return Cache::get($fullName);}diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.phpindex d93b22026d..ef8e443d78 100644--- a/app/Support/Twig/Extension/Transaction.php+++ b/app/Support/Twig/Extension/Transaction.php@@ -58,7 +58,7 @@ class Transaction extends Twig_Extension$coloured = true;// at this point amount is always negative.- if ($transaction->transaction_type_type === TransactionType::RECONCILIATION && bccomp(strval($transaction->transaction_amount),'0') === 1) {+ if (TransactionType::RECONCILIATION === $transaction->transaction_type_type && 1 === bccomp(strval($transaction->transaction_amount), '0')) {$amount = bcmul($amount, '-1');}@@ -290,7 +290,7 @@ class Transaction extends Twig_Extensionreturn $cache->get();}- if($transaction->transaction_type_type === TransactionType::RECONCILIATION) {+ if (TransactionType::RECONCILIATION === $transaction->transaction_type_type) {return '—';}@@ -476,7 +476,7 @@ class Transaction extends Twig_Extensionif ($cache->has()) {return $cache->get();}- if($transaction->transaction_type_type === TransactionType::RECONCILIATION) {+ if (TransactionType::RECONCILIATION === $transaction->transaction_type_type) {return '—';}diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.phpindex 38da2546ed..754972cd4a 100644--- a/app/Support/Twig/General.php+++ b/app/Support/Twig/General.php@@ -148,21 +148,6 @@ class General extends Twig_Extension);}- /**- * @return Twig_SimpleFilter- */- protected function markdown(): Twig_SimpleFilter- {- return new Twig_SimpleFilter(- 'markdown',- function (string $text): string {- $converter = new CommonMarkConverter;-- return $converter->convertToHtml($text);- },['is_safe' => ['html']]- );- }-/*** @return Twig_SimpleFilter*/@@ -181,7 +166,6 @@ class General extends Twig_Extension);}-/*** @return Twig_SimpleFunction*/@@ -244,6 +228,21 @@ class General extends Twig_Extension);}+ /**+ * @return Twig_SimpleFilter+ */+ protected function markdown(): Twig_SimpleFilter+ {+ return new Twig_SimpleFilter(+ 'markdown',+ function (string $text): string {+ $converter = new CommonMarkConverter;++ return $converter->convertToHtml($text);+ }, ['is_safe' => ['html']]+ );+ }+/*** @return Twig_SimpleFilter*/diff --git a/config/csv.php b/config/csv.phpindex fa296fe055..a10ea901ba 100644--- a/config/csv.php+++ b/config/csv.php@@ -280,13 +280,13 @@ return ['converter' => 'Amount','field' => 'amount',],- 'amount_debet' => [+ 'amount_debet' => ['mappable' => false,'pre-process-map' => false,'converter' => 'AmountDebet','field' => 'amount_debet',],- 'amount_credit' => [+ 'amount_credit' => ['mappable' => false,'pre-process-map' => false,'converter' => 'AmountCredit',diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.phpindex d42ab2c9b7..85bedc97cf 100644--- a/database/factories/ModelFactory.php+++ b/database/factories/ModelFactory.php@@ -29,10 +29,10 @@ $factory->define(static $password;return [- 'email' => $faker->safeEmail,- 'password' => $password ?: $password = bcrypt('secret'),- 'remember_token' => str_random(10),- ];+ 'email' => $faker->safeEmail,+ 'password' => $password ?: $password = bcrypt('secret'),+ 'remember_token' => str_random(10),+ ];});@@ -40,13 +40,13 @@ $factory->define(FireflyIII\Models\CurrencyExchangeRate::class,function (Faker\Generator $faker) {return [- 'user_id' => 1,- 'from_currency_id' => 1,- 'to_currency_id' => 2,- 'date' => '2017-01-01',- 'rate' => '1.5',- 'user_rate' => null,- ];+ 'user_id' => 1,+ 'from_currency_id' => 1,+ 'to_currency_id' => 2,+ 'date' => '2017-01-01',+ 'rate' => '1.5',+ 'user_rate' => null,+ ];});@@ -54,10 +54,10 @@ $factory->define(FireflyIII\Models\TransactionCurrency::class,function (Faker\Generator $faker) {return [- 'name' => $faker->words(1, true),- 'code' => 'ABC',- 'symbol' => 'x',- ];+ 'name' => $faker->words(1, true),+ 'code' => 'ABC',+ 'symbol' => 'x',+ ];});@@ -65,44 +65,43 @@ $factory->define(FireflyIII\Models\ImportJob::class,function (Faker\Generator $faker) {return [- 'id' => $faker->numberBetween(1, 100),- 'user_id' => 1,- 'key' => $faker->words(1, true),- 'file_type' => 'csv',- 'status' => 'import_status_never_started',- 'configuration' => null,- 'extended_status' => [- 'total_steps' => 0,- 'steps_done' => 0,- 'import_count' => 0,- 'importTag' => 0,- 'errors' => [],- ],- ];+ 'id' => $faker->numberBetween(1, 100),+ 'user_id' => 1,+ 'key' => $faker->words(1, true),+ 'file_type' => 'csv',+ 'status' => 'import_status_never_started',+ 'configuration' => null,+ 'extended_status' => [+ 'total_steps' => 0,+ 'steps_done' => 0,+ 'import_count' => 0,+ 'importTag' => 0,+ 'errors' => [],+ ],+ ];});-$factory->define(FireflyIII\Models\TransactionJournal::class,function (Faker\Generator $faker) {return [- 'id' => $faker->unique()->numberBetween(1000, 10000),- 'user_id' => 1,- 'transaction_type_id' => 1,- 'bill_id' => null,- // TODO update this transaction currency reference.- 'transaction_currency_id' => 1,- 'description' => $faker->words(3, true),- 'date' => '2017-01-01',- 'interest_date' => null,- 'book_date' => null,- 'process_date' => null,- 'order' => 0,- 'tag_count' => 0,- 'encrypted' => 0,- 'completed' => 1,- ];+ 'id' => $faker->unique()->numberBetween(1000, 10000),+ 'user_id' => 1,+ 'transaction_type_id' => 1,+ 'bill_id' => null,+ // TODO update this transaction currency reference.+ 'transaction_currency_id' => 1,+ 'description' => $faker->words(3, true),+ 'date' => '2017-01-01',+ 'interest_date' => null,+ 'book_date' => null,+ 'process_date' => null,+ 'order' => 0,+ 'tag_count' => 0,+ 'encrypted' => 0,+ 'completed' => 1,+ ];});@@ -110,19 +109,19 @@ $factory->define(FireflyIII\Models\Bill::class,function (Faker\Generator $faker) {return [- 'id' => $faker->numberBetween(1, 10),- 'user_id' => 1,- 'name' => $faker->words(3, true),- 'match' => $faker->words(3, true),- 'amount_min' => '100.00',- 'amount_max' => '100.00',- 'date' => '2017-01-01',- 'repeat_freq' => 'monthly',- 'skip' => 0,- 'automatch' => 1,- 'name_encrypted' => 0,- 'match_encrypted' => 0,- ];+ 'id' => $faker->numberBetween(1, 10),+ 'user_id' => 1,+ 'name' => $faker->words(3, true),+ 'match' => $faker->words(3, true),+ 'amount_min' => '100.00',+ 'amount_max' => '100.00',+ 'date' => '2017-01-01',+ 'repeat_freq' => 'monthly',+ 'skip' => 0,+ 'automatch' => 1,+ 'name_encrypted' => 0,+ 'match_encrypted' => 0,+ ];});@@ -130,12 +129,12 @@ $factory->define(FireflyIII\Models\PiggyBankRepetition::class,function (Faker\Generator $faker) {return [- 'id' => $faker->unique()->numberBetween(100, 10000),- 'piggy_bank_id' => $faker->numberBetween(1, 10),- 'startdate' => '2017-01-01',- 'targetdate' => '2020-01-01',- 'currentamount' => 10,- ];+ 'id' => $faker->unique()->numberBetween(100, 10000),+ 'piggy_bank_id' => $faker->numberBetween(1, 10),+ 'startdate' => '2017-01-01',+ 'targetdate' => '2020-01-01',+ 'currentamount' => 10,+ ];});@@ -143,15 +142,15 @@ $factory->define(FireflyIII\Models\PiggyBank::class,function (Faker\Generator $faker) {return [- 'id' => $faker->unique()->numberBetween(100, 10000),- 'account_id' => $faker->numberBetween(1, 10),- 'name' => $faker->words(3, true),- 'target_amount' => '1000.00',- 'startdate' => '2017-01-01',- 'order' => 1,- 'active' => 1,- 'encrypted' => 0,- ];+ 'id' => $faker->unique()->numberBetween(100, 10000),+ 'account_id' => $faker->numberBetween(1, 10),+ 'name' => $faker->words(3, true),+ 'target_amount' => '1000.00',+ 'startdate' => '2017-01-01',+ 'order' => 1,+ 'active' => 1,+ 'encrypted' => 0,+ ];});@@ -159,11 +158,11 @@ $factory->define(FireflyIII\Models\Tag::class,function (Faker\Generator $faker) {return [- 'id' => $faker->unique()->numberBetween(200, 10000),- 'user_id' => 1,- 'tagMode' => 'nothing',- 'tag' => $faker->words(1, true),- ];+ 'id' => $faker->unique()->numberBetween(200, 10000),+ 'user_id' => 1,+ 'tagMode' => 'nothing',+ 'tag' => $faker->words(1, true),+ ];});@@ -171,9 +170,9 @@ $factory->define(FireflyIII\Models\Category::class,function (Faker\Generator $faker) {return [- 'id' => $faker->numberBetween(1, 10),- 'name' => $faker->words(3, true),- ];+ 'id' => $faker->numberBetween(1, 10),+ 'name' => $faker->words(3, true),+ ];});@@ -181,9 +180,9 @@ $factory->define(FireflyIII\Models\Budget::class,function (Faker\Generator $faker) {return [- 'id' => $faker->numberBetween(1, 10),- 'name' => $faker->words(3, true),- ];+ 'id' => $faker->numberBetween(1, 10),+ 'name' => $faker->words(3, true),+ ];});@@ -191,12 +190,12 @@ $factory->define(FireflyIII\Models\PiggyBankEvent::class,function (Faker\Generator $faker) {return [- 'id' => $faker->numberBetween(1, 10),- 'piggy_bank_id' => $faker->numberBetween(1, 10),- 'transaction_journal_id' => $faker->numberBetween(1, 10),- 'date' => $faker->date('Y-m-d'),- 'amount' => '100',- ];+ 'id' => $faker->numberBetween(1, 10),+ 'piggy_bank_id' => $faker->numberBetween(1, 10),+ 'transaction_journal_id' => $faker->numberBetween(1, 10),+ 'date' => $faker->date('Y-m-d'),+ 'amount' => '100',+ ];});@@ -204,13 +203,12 @@ $factory->define(FireflyIII\Models\BudgetLimit::class,function (Faker\Generator $faker) {return [- 'id' => $faker->numberBetween(1, 10),- 'start_date' => '2017-01-01',- 'end_date' => '2017-01-31',- 'amount' => '300',- 'budget_id' => $faker->numberBetween(1, 6),-- ];+ 'id' => $faker->numberBetween(1, 10),+ 'start_date' => '2017-01-01',+ 'end_date' => '2017-01-31',+ 'amount' => '300',+ 'budget_id' => $faker->numberBetween(1, 6),+ ];});@@ -218,11 +216,11 @@ $factory->define(FireflyIII\Models\Account::class,function (Faker\Generator $faker) {return [- 'id' => $faker->unique()->numberBetween(1000, 10000),- 'name' => $faker->words(3, true),- 'account_type_id' => 1,- 'active' => true,- ];+ 'id' => $faker->unique()->numberBetween(1000, 10000),+ 'name' => $faker->words(3, true),+ 'account_type_id' => 1,+ 'active' => true,+ ];});@@ -230,31 +228,31 @@ $factory->define(FireflyIII\Models\Transaction::class,function (Faker\Generator $faker) {return [- 'transaction_amount' => strval($faker->randomFloat(2, -100, 100)),- 'destination_amount' => strval($faker->randomFloat(2, -100, 100)),- 'opposing_account_id' => $faker->numberBetween(1, 10),- 'source_account_id' => $faker->numberBetween(1, 10),- 'opposing_account_name' => $faker->words(3, true),- 'description' => $faker->words(3, true),- 'source_account_name' => $faker->words(3, true),- 'destination_account_id' => $faker->numberBetween(1, 10),- 'date' => new Carbon,- 'destination_account_name' => $faker->words(3, true),- 'amount' => strval($faker->randomFloat(2, -100, 100)),- 'budget_id' => 0,- 'category' => $faker->words(3, true),- 'transaction_journal_id' => $faker->numberBetween(1, 10),- 'journal_id' => $faker->numberBetween(1, 10),- 'transaction_currency_code' => 'EUR',- 'transaction_type_type' => 'Withdrawal',- 'account_encrypted' => 0,- 'account_name' => 'Some name',- 'transaction_currency_id' => 1,- 'transaction_currency_symbol' => '€',- 'foreign_destination_amount' => null,- 'foreign_currency_id' => null,- 'foreign_currency_code' => null,- 'foreign_currency_symbol' => null,- ];+ 'transaction_amount' => strval($faker->randomFloat(2, -100, 100)),+ 'destination_amount' => strval($faker->randomFloat(2, -100, 100)),+ 'opposing_account_id' => $faker->numberBetween(1, 10),+ 'source_account_id' => $faker->numberBetween(1, 10),+ 'opposing_account_name' => $faker->words(3, true),+ 'description' => $faker->words(3, true),+ 'source_account_name' => $faker->words(3, true),+ 'destination_account_id' => $faker->numberBetween(1, 10),+ 'date' => new Carbon,+ 'destination_account_name' => $faker->words(3, true),+ 'amount' => strval($faker->randomFloat(2, -100, 100)),+ 'budget_id' => 0,+ 'category' => $faker->words(3, true),+ 'transaction_journal_id' => $faker->numberBetween(1, 10),+ 'journal_id' => $faker->numberBetween(1, 10),+ 'transaction_currency_code' => 'EUR',+ 'transaction_type_type' => 'Withdrawal',+ 'account_encrypted' => 0,+ 'account_name' => 'Some name',+ 'transaction_currency_id' => 1,+ 'transaction_currency_symbol' => '€',+ 'foreign_destination_amount' => null,+ 'foreign_currency_id' => null,+ 'foreign_currency_code' => null,+ 'foreign_currency_symbol' => null,+ ];});diff --git a/database/migrations/2016_06_16_000000_create_support_tables.php b/database/migrations/2016_06_16_000000_create_support_tables.phpindex b3f848bee0..b47de14d0b 100644--- a/database/migrations/2016_06_16_000000_create_support_tables.php+++ b/database/migrations/2016_06_16_000000_create_support_tables.php@@ -20,7 +20,6 @@ class CreateSupportTables extends Migration{/*** Reverse the migrations.- **/public function down(){@@ -124,8 +123,7 @@ class CreateSupportTables extends MigrationSchema::create('jobs',function (Blueprint $table) {-- // straight from Laravel+ // straight from Laravel$table->bigIncrements('id');$table->string('queue');$table->longText('payload');diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.phpindex 4823ac9e39..edc7eb3b36 100644--- a/database/migrations/2016_06_16_000002_create_main_tables.php+++ b/database/migrations/2016_06_16_000002_create_main_tables.php@@ -60,7 +60,6 @@ class CreateMainTables extends Migration*/public function up(){- //$this->createAccountTables();$this->createPiggyBanksTable();$this->createAttachmentsTable();@@ -433,7 +432,6 @@ class CreateMainTables extends Migration$table->boolean('active')->default(1);$table->boolean('stop_processing')->default(0);-// link rule id to rules table$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');}@@ -454,7 +452,6 @@ class CreateMainTables extends Migration$table->boolean('active')->default(1);$table->boolean('stop_processing')->default(0);-// link rule id to rules table$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');}@@ -583,7 +580,6 @@ class CreateMainTables extends Migration);}-if (!Schema::hasTable('piggy_bank_events')) {Schema::create('piggy_bank_events',diff --git a/database/migrations/2016_08_25_091522_changes_for_3101.php b/database/migrations/2016_08_25_091522_changes_for_3101.phpindex 06389fba1a..4a9c2a33ec 100644--- a/database/migrations/2016_08_25_091522_changes_for_3101.php+++ b/database/migrations/2016_08_25_091522_changes_for_3101.php@@ -23,7 +23,6 @@ class ChangesFor3101 extends Migration*/public function down(){- //}/**diff --git a/database/migrations/2016_09_12_121359_fix_nullables.php b/database/migrations/2016_09_12_121359_fix_nullables.phpindex d448b84c77..164e3e5236 100644--- a/database/migrations/2016_09_12_121359_fix_nullables.php+++ b/database/migrations/2016_09_12_121359_fix_nullables.php@@ -18,7 +18,6 @@ use Illuminate\Database\Schema\Blueprint;*/class FixNullables extends Migration{-/*** Reverse the migrations.*/diff --git a/database/migrations/2016_10_09_150037_expand_transactions_table.php b/database/migrations/2016_10_09_150037_expand_transactions_table.phpindex 4c2b750c4b..2e33905fd8 100644--- a/database/migrations/2016_10_09_150037_expand_transactions_table.php+++ b/database/migrations/2016_10_09_150037_expand_transactions_table.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use Illuminate\Database\Migrations\Migration;@@ -24,7 +23,6 @@ class ExpandTransactionsTable extends Migration*/public function down(){- //}/**diff --git a/database/migrations/2016_10_22_075804_changes_for_v410.php b/database/migrations/2016_10_22_075804_changes_for_v410.phpindex 308d5e13ba..b3931aeb78 100644--- a/database/migrations/2016_10_22_075804_changes_for_v410.php+++ b/database/migrations/2016_10_22_075804_changes_for_v410.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use Illuminate\Database\Migrations\Migration;diff --git a/database/migrations/2016_11_24_210552_changes_for_v420.php b/database/migrations/2016_11_24_210552_changes_for_v420.phpindex c118c12a47..1ca2c5b652 100644--- a/database/migrations/2016_11_24_210552_changes_for_v420.php+++ b/database/migrations/2016_11_24_210552_changes_for_v420.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use Illuminate\Database\Migrations\Migration;@@ -24,7 +23,6 @@ class ChangesForV420 extends Migration*/public function down(){- //}/**diff --git a/database/migrations/2016_12_22_150431_changes_for_v430.php b/database/migrations/2016_12_22_150431_changes_for_v430.phpindex 69a32f727e..57be784576 100644--- a/database/migrations/2016_12_22_150431_changes_for_v430.php+++ b/database/migrations/2016_12_22_150431_changes_for_v430.php@@ -8,10 +8,8 @@** See the LICENSE file for details.*/-declare(strict_types=1);-use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;@@ -47,7 +45,6 @@ class ChangesForV430 extends Migration$table->date('start_date');$table->date('end_date');-$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');}diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.phpindex 7e856c4987..9beb9fd9f6 100644--- a/database/migrations/2016_12_28_203205_changes_for_v431.php+++ b/database/migrations/2016_12_28_203205_changes_for_v431.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use Illuminate\Database\Migrations\Migration;@@ -21,8 +20,6 @@ class ChangesForV431 extends Migration{/*** Reverse the migrations.- *- * @return void*/public function down(){@@ -40,7 +37,6 @@ class ChangesForV431 extends Migration});-// remove date field "end_date"Schema::table('budget_limits',diff --git a/database/migrations/2017_04_13_163623_changes_for_v440.php b/database/migrations/2017_04_13_163623_changes_for_v440.phpindex bc18523dfc..be6aa0e697 100644--- a/database/migrations/2017_04_13_163623_changes_for_v440.php+++ b/database/migrations/2017_04_13_163623_changes_for_v440.php@@ -8,10 +8,8 @@** See the LICENSE file for details.*/-declare(strict_types=1);-use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;@@ -22,8 +20,6 @@ class ChangesForV440 extends Migration{/*** Reverse the migrations.- *- * @return void*/public function down(){@@ -36,7 +32,6 @@ class ChangesForV440 extends Migration* Run the migrations.** @SuppressWarnings(PHPMD.ShortMethodName)- * @return void*/public function up(){@@ -60,7 +55,7 @@ class ChangesForV440 extends Migration});}- //+Schema::table('transactions',function (Blueprint $table) {diff --git a/database/migrations/2017_06_02_105232_changes_for_v450.php b/database/migrations/2017_06_02_105232_changes_for_v450.phpindex 430565399d..dbc92fe4da 100644--- a/database/migrations/2017_06_02_105232_changes_for_v450.php+++ b/database/migrations/2017_06_02_105232_changes_for_v450.php@@ -8,10 +8,8 @@** See the LICENSE file for details.*/-declare(strict_types=1);-use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;@@ -22,8 +20,6 @@ class ChangesForV450 extends Migration{/*** Reverse the migrations.- *- * @return void*/public function down(){@@ -33,7 +29,6 @@ class ChangesForV450 extends Migration* Run the migrations.** @SuppressWarnings(PHPMD.ShortMethodName)- * @return void*/public function up(){diff --git a/database/migrations/2017_08_20_062014_changes_for_v470.php b/database/migrations/2017_08_20_062014_changes_for_v470.phpindex 06743a5e3d..0f1173a17f 100644--- a/database/migrations/2017_08_20_062014_changes_for_v470.php+++ b/database/migrations/2017_08_20_062014_changes_for_v470.php@@ -1,6 +1,6 @@<?php-declare(strict_types=1);+declare(strict_types=1);use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;@@ -13,8 +13,6 @@ class ChangesForV470 extends Migration{/*** Reverse the migrations.- *- * @return void*/public function down(){@@ -26,7 +24,6 @@ class ChangesForV470 extends Migration* Run the migrations.** @SuppressWarnings(PHPMD.ShortMethodName)- * @return void*/public function up(){@@ -42,7 +39,7 @@ class ChangesForV470 extends Migration$table->string('inward');$table->boolean('editable');- $table->unique(['name', 'outward','inward']);+ $table->unique(['name', 'outward', 'inward']);});}@@ -62,7 +59,7 @@ class ChangesForV470 extends Migration$table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade');$table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade');- $table->unique(['link_type_id','source_id','destination_id']);+ $table->unique(['link_type_id', 'source_id', 'destination_id']);});}diff --git a/database/migrations/2017_11_04_170844_changes_for_v470a.php b/database/migrations/2017_11_04_170844_changes_for_v470a.phpindex 4b0e593ece..6ebbdb0a23 100644--- a/database/migrations/2017_11_04_170844_changes_for_v470a.php+++ b/database/migrations/2017_11_04_170844_changes_for_v470a.php@@ -1,6 +1,6 @@<?php-declare(strict_types=1);+declare(strict_types=1);use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;@@ -10,19 +10,15 @@ class ChangesForV470a extends Migration{/*** Reverse the migrations.- *- * @return void*/public function down(){- //}/*** Run the migrations.** @SuppressWarnings(PHPMD.ShortMethodName)- * @return void*/public function up(){diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.phpindex 9ebbbfa91d..2a1b072141 100644--- a/database/seeds/AccountTypeSeeder.php+++ b/database/seeds/AccountTypeSeeder.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use FireflyIII\Models\AccountType;diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.phpindex 47ab443f6d..11505d148a 100644--- a/database/seeds/DatabaseSeeder.php+++ b/database/seeds/DatabaseSeeder.php@@ -19,8 +19,6 @@ class DatabaseSeeder extends Seeder{/*** Run the database seeds.- *- * @return void*/public function run(){diff --git a/database/seeds/LinkTypeSeeder.php b/database/seeds/LinkTypeSeeder.phpindex 8b7fc24e9a..4662d0820c 100644--- a/database/seeds/LinkTypeSeeder.php+++ b/database/seeds/LinkTypeSeeder.php@@ -7,10 +7,8 @@** See the LICENSE file for details.*/-declare(strict_types=1);-use FireflyIII\Models\LinkType;use Illuminate\Database\Seeder;diff --git a/database/seeds/PermissionSeeder.php b/database/seeds/PermissionSeeder.phpindex 29871b6122..f24ef6b1c0 100644--- a/database/seeds/PermissionSeeder.php+++ b/database/seeds/PermissionSeeder.php@@ -8,10 +8,8 @@** See the LICENSE file for details.*/-declare(strict_types=1);-use FireflyIII\Models\Role;use Illuminate\Database\Seeder;diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.phpindex 9b82d9fcb8..31b3650681 100644--- a/database/seeds/TransactionCurrencySeeder.php+++ b/database/seeds/TransactionCurrencySeeder.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use FireflyIII\Models\TransactionCurrency;@@ -50,11 +49,5 @@ class TransactionCurrencySeeder extends SeederTransactionCurrency::create(['code' => 'XBT', 'name' => 'Bitcoin', 'symbol' => '₿', 'decimal_places' => 8]);TransactionCurrency::create(['code' => 'BCH', 'name' => 'Bitcoin cash', 'symbol' => '₿C', 'decimal_places' => 8]);TransactionCurrency::create(['code' => 'ETH', 'name' => 'Ethereum', 'symbol' => 'Ξ', 'decimal_places' => 12]);------}}diff --git a/database/seeds/TransactionTypeSeeder.php b/database/seeds/TransactionTypeSeeder.phpindex c9d9cc37df..f12c118758 100644--- a/database/seeds/TransactionTypeSeeder.php+++ b/database/seeds/TransactionTypeSeeder.php@@ -8,7 +8,6 @@** See the LICENSE file for details.*/-declare(strict_types=1);use FireflyIII\Models\TransactionType;diff --git a/public/js/ff/charts.js b/public/js/ff/charts.jsindex 4595bb6a4a..c4d42ae173 100644--- a/public/js/ff/charts.js+++ b/public/js/ff/charts.js@@ -21,8 +21,6 @@var allCharts = {};--/*Make some colours:*/@@ -61,8 +59,6 @@ Chart.defaults.global.responsive = true;Chart.defaults.global.maintainAspectRatio = false;--/*** Chart line thing*/@@ -92,12 +88,15 @@ const verticalLinePlugin = {afterDatasetsDraw: function (chart, easing) {if (chart.config.lineAtIndex) {- chart.config.lineAtIndex.forEach(pointIndex => this.renderVerticalLine(chart, pointIndex));+ chart.config.lineAtIndex.forEach(pointIndex = > this.renderVerticalLine(chart, pointIndex)+ )+ ;}}};Chart.plugins.register(verticalLinePlugin);+/**** @param data@@ -343,8 +342,8 @@ function drawAChart(URI, container, chartType, options, colorData, today) {options: options,lineAtIndex: []};- if(today >= 0) {- chartOpts.lineAtIndex.push(today-1);+ if (today >= 0) {+ chartOpts.lineAtIndex.push(today - 1);console.log('push opt');}allCharts[container] = new Chart(ctx, chartOpts);diff --git a/public/js/ff/index.js b/public/js/ff/index.jsindex 2dfb20fa92..114ce5315a 100644--- a/public/js/ff/index.js+++ b/public/js/ff/index.js@@ -29,7 +29,7 @@ $(function () {function drawChart() {"use strict";- if(today >= 0) {+ if (today >= 0) {lineChartWithDay(accountFrontpageUri, 'accounts-chart', today);} else {lineChart(accountFrontpageUri, 'accounts-chart');diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.phpindex f74c104bda..03b1443d26 100644--- a/tests/CreatesApplication.php+++ b/tests/CreatesApplication.php@@ -18,10 +18,8 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);-namespace Tests;use Illuminate\Contracts\Console\Kernel;diff --git a/tests/Feature/Controllers/AccountControllerTest.php b/tests/Feature/Controllers/AccountControllerTest.phpindex e8bf5a1d40..c21501e367 100644--- a/tests/Feature/Controllers/AccountControllerTest.php+++ b/tests/Feature/Controllers/AccountControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -42,7 +41,6 @@ use Tests\TestCase;/*** Class AccountControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -79,7 +77,6 @@ class AccountControllerTest extends TestCase$repository->shouldReceive('getAccountsByType')->withArgs([[AccountType::ASSET]])->andReturn(new Collection);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->be($this->user());$account = $this->user()->accounts()->where('account_type_id', 3)->whereNull('deleted_at')->first();$response = $this->get(route('accounts.delete', [$account->id]));@@ -191,7 +188,6 @@ class AccountControllerTest extends TestCase$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([$transaction], 0, 10));-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('accounts.show', [1]));@@ -222,7 +218,6 @@ class AccountControllerTest extends TestCase$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([$transaction], 0, 10));-$tasker = $this->mock(AccountTaskerInterface::class);$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');diff --git a/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php b/tests/Feature/Controllers/Admin/ConfigurationControllerTest.phpindex 7181a3c956..5b2aeb57b8 100644--- a/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php+++ b/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Admin;-use FireflyConfig;use FireflyIII\Models\Configuration;use Tests\TestCase;@@ -31,14 +29,12 @@ use Tests\TestCase;/*** Class ConfigurationControllerTest*- * @package Tests\Feature\Controllers\Admin* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ConfigurationControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::index* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::__construct@@ -80,5 +76,4 @@ class ConfigurationControllerTest extends TestCase$response->assertSessionHas('success');$response->assertStatus(302);}-}diff --git a/tests/Feature/Controllers/Admin/HomeControllerTest.php b/tests/Feature/Controllers/Admin/HomeControllerTest.phpindex e34ede9b46..3c87eb27af 100644--- a/tests/Feature/Controllers/Admin/HomeControllerTest.php+++ b/tests/Feature/Controllers/Admin/HomeControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Admin;@@ -28,14 +27,12 @@ use Tests\TestCase;/*** Class HomeControllerTest*- * @package Tests\Feature\Controllers\Admin* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class HomeControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Admin\HomeController::index*/@@ -47,5 +44,4 @@ class HomeControllerTest extends TestCase// has bread crumb$response->assertSee('<ol class="breadcrumb">');}-}diff --git a/tests/Feature/Controllers/Admin/UserControllerTest.php b/tests/Feature/Controllers/Admin/UserControllerTest.phpindex 645fb8638f..51a8e616cf 100644--- a/tests/Feature/Controllers/Admin/UserControllerTest.php+++ b/tests/Feature/Controllers/Admin/UserControllerTest.php@@ -18,10 +18,8 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);-namespace Tests\Feature\Controllers\Admin;use FireflyIII\Repositories\User\UserRepositoryInterface;@@ -31,7 +29,6 @@ use Tests\TestCase;/*** Class UserControllerTest*- * @package Tests\Feature\Controllers\Admin* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -111,6 +108,4 @@ class UserControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}--}diff --git a/tests/Feature/Controllers/AttachmentControllerTest.php b/tests/Feature/Controllers/AttachmentControllerTest.phpindex f96cde0db5..34c53002fe 100644--- a/tests/Feature/Controllers/AttachmentControllerTest.php+++ b/tests/Feature/Controllers/AttachmentControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;use FireflyIII\Repositories\Journal\JournalRepositoryInterface;@@ -32,7 +30,6 @@ use Tests\TestCase;/*** Class AttachmentControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -103,7 +100,6 @@ class AttachmentControllerTest extends TestCase$repository->shouldReceive('exists')->once()->andReturn(false);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->be($this->user());$response = $this->get(route('attachments.download', [1]));$response->assertStatus(500);@@ -159,6 +155,4 @@ class AttachmentControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}--}diff --git a/tests/Feature/Controllers/Auth/ForgotPasswordControllerTest.php b/tests/Feature/Controllers/Auth/ForgotPasswordControllerTest.phpindex e6758b71db..82e4686471 100644--- a/tests/Feature/Controllers/Auth/ForgotPasswordControllerTest.php+++ b/tests/Feature/Controllers/Auth/ForgotPasswordControllerTest.php@@ -18,19 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Auth;-use FireflyIII\Repositories\User\UserRepositoryInterface;use Tests\TestCase;/*** Class ForgotPasswordControllerTest*- * @package Tests\Feature\Controllers\Auth* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)diff --git a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.phpindex 7983be62d4..291ba110d6 100644--- a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php+++ b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Auth;-use FireflyIII\Models\Preference;use PragmaRX\Google2FA\Contracts\Google2FA;use Preferences;@@ -32,7 +30,6 @@ use Tests\TestCase;/*** Class TwoFactorControllerTest*- * @package Tests\Feature\Controllers\Auth* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -51,7 +48,6 @@ class TwoFactorControllerTest extends TestCase$secretPreference = new Preference;$secretPreference->data = 'BlablaSeecret';-Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();@@ -130,5 +126,4 @@ class TwoFactorControllerTest extends TestCase$response = $this->post(route('two-factor.post'), $data);$response->assertStatus(302);}-}diff --git a/tests/Feature/Controllers/BillControllerTest.php b/tests/Feature/Controllers/BillControllerTest.phpindex e93a31bb21..df33f3b1a2 100644--- a/tests/Feature/Controllers/BillControllerTest.php+++ b/tests/Feature/Controllers/BillControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;-use Carbon\Carbon;use FireflyIII\Helpers\Collector\JournalCollectorInterface;use FireflyIII\Models\Bill;@@ -37,7 +35,6 @@ use Tests\TestCase;/*** Class BillControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -252,7 +249,5 @@ class BillControllerTest extends TestCase$response = $this->post(route('bills.update', [1]), $data);$response->assertStatus(302);$response->assertSessionHas('success');-}-}diff --git a/tests/Feature/Controllers/BudgetControllerTest.php b/tests/Feature/Controllers/BudgetControllerTest.phpindex db039117f3..4cb5a4f24e 100644--- a/tests/Feature/Controllers/BudgetControllerTest.php+++ b/tests/Feature/Controllers/BudgetControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -38,7 +37,6 @@ use Tests\TestCase;/*** Class BudgetControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -184,7 +182,6 @@ class BudgetControllerTest extends TestCase$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('budgets.index'));@@ -231,7 +228,6 @@ class BudgetControllerTest extends TestCase$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('budgets.index', ['2017-01-01']));@@ -278,7 +274,6 @@ class BudgetControllerTest extends TestCase$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('budgets.index', ['Hello-there']));@@ -455,7 +450,6 @@ class BudgetControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\BudgetController::showByBudgetLimit* @expectedExceptionMessage This budget limit is not part of- **/public function testShowByBadBudgetLimit(){@@ -484,7 +478,6 @@ class BudgetControllerTest extends TestCase$accountRepository = $this->mock(AccountRepositoryInterface::class);$accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);-// mock budget repository$budgetRepository = $this->mock(BudgetRepositoryInterface::class);$budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');@@ -500,7 +493,6 @@ class BudgetControllerTest extends TestCase$collector->shouldReceive('withBudgetInformation')->andReturnSelf();$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('budgets.show.limit', [1, 1]));@@ -575,5 +567,4 @@ class BudgetControllerTest extends TestCase$response = $this->get(route('budgets.income', ['2017-01-01', '2017-01-31']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/CategoryControllerTest.php b/tests/Feature/Controllers/CategoryControllerTest.phpindex d6cf76584e..478a9842c1 100644--- a/tests/Feature/Controllers/CategoryControllerTest.php+++ b/tests/Feature/Controllers/CategoryControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -40,7 +39,6 @@ use Tests\TestCase;/*** Class CategoryControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -89,7 +87,6 @@ class CategoryControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$repository->shouldReceive('destroy')->andReturn(true);$this->session(['categories.delete.uri' => 'http://localhost']);@@ -360,7 +357,6 @@ class CategoryControllerTest extends TestCase$repository->shouldReceive('spentInPeriod')->andReturn('-1');$repository->shouldReceive('earnedInPeriod')->andReturn('1');-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('categories.show', [1, '2015-01-01']));@@ -456,6 +452,4 @@ class CategoryControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}--}diff --git a/tests/Feature/Controllers/Chart/AccountControllerTest.php b/tests/Feature/Controllers/Chart/AccountControllerTest.phpindex 8ac9996047..3ff5fcff07 100644--- a/tests/Feature/Controllers/Chart/AccountControllerTest.php+++ b/tests/Feature/Controllers/Chart/AccountControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use Carbon\Carbon;use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Helpers\Collector\JournalCollectorInterface;@@ -43,14 +41,12 @@ use Tests\TestCase;/*** Class AccountControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class AccountControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Chart\AccountController::all*/@@ -85,7 +81,6 @@ class AccountControllerTest extends TestCase$generator->shouldReceive('singleSet')->andReturn([]);Steam::shouldReceive('balancesByAccounts')->twice()->andReturn([]);-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('chart.account.expense'));@@ -114,7 +109,6 @@ class AccountControllerTest extends TestCase$generator->shouldReceive('pieChart')->andReturn([]);$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('chart.account.expense-budget', [1, '20120101', '20120131']));@@ -145,7 +139,6 @@ class AccountControllerTest extends TestCase$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('chart.account.expense-budget-all', [1]));@@ -374,5 +367,4 @@ class AccountControllerTest extends TestCase$response = $this->get(route('chart.account.single', [1]));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Chart/BillControllerTest.php b/tests/Feature/Controllers/Chart/BillControllerTest.phpindex 64bfc23927..36db106a3a 100644--- a/tests/Feature/Controllers/Chart/BillControllerTest.php+++ b/tests/Feature/Controllers/Chart/BillControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Helpers\Collector\JournalCollectorInterface;use FireflyIII\Models\Transaction;@@ -34,7 +32,6 @@ use Tests\TestCase;/*** Class BillControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -82,5 +79,4 @@ class BillControllerTest extends TestCase$response = $this->get(route('chart.bill.single', [1]));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Chart/BudgetControllerTest.php b/tests/Feature/Controllers/Chart/BudgetControllerTest.phpindex 1be3f7583b..95b6f645b8 100644--- a/tests/Feature/Controllers/Chart/BudgetControllerTest.php+++ b/tests/Feature/Controllers/Chart/BudgetControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use Carbon\Carbon;use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Helpers\Collector\JournalCollectorInterface;@@ -42,14 +40,12 @@ use Tests\TestCase;/*** Class BudgetControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class BudgetControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budget* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::__construct@@ -66,7 +62,6 @@ class BudgetControllerTest extends TestCase$repository->shouldReceive('spentInPeriod')->andReturn('-100');$generator->shouldReceive('singleSet')->andReturn([])->once();-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('chart.budget.budget', [1]));@@ -84,7 +79,6 @@ class BudgetControllerTest extends TestCase$repository = $this->mock(BudgetRepositoryInterface::class);$generator = $this->mock(GeneratorInterface::class);-$repository->shouldReceive('spentInPeriod')->andReturn('-100');$generator->shouldReceive('singleSet')->once()->andReturn([]);@@ -214,7 +208,6 @@ class BudgetControllerTest extends TestCase$budgetLimit->budget_id = $budget->id;$transaction = factory(Transaction::class)->make();-$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]))->once();$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection([$budgetLimit]));$repository->shouldReceive('spentInPeriod')->andReturn('-100');@@ -254,7 +247,6 @@ class BudgetControllerTest extends TestCase$two->budget_id = $budget->id;$transaction = factory(Transaction::class)->make();-$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]))->once();$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection([$one, $two]));$repository->shouldReceive('spentInPeriod')->andReturn('-100');@@ -290,7 +282,6 @@ class BudgetControllerTest extends TestCase$budget = factory(Budget::class)->make();$transaction = factory(Transaction::class)->make();-$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection);$repository->shouldReceive('spentInPeriod')->andReturn('-100');@@ -325,7 +316,6 @@ class BudgetControllerTest extends TestCase$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));$generator->shouldReceive('multiSet')->once()->andReturn([]);-$this->be($this->user());$response = $this->get(route('chart.budget.period', [1, '1', '20120101', '20120131']));$response->assertStatus(200);diff --git a/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php b/tests/Feature/Controllers/Chart/BudgetReportControllerTest.phpindex 53376c22a2..0868942ddc 100644--- a/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php+++ b/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use Carbon\Carbon;use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Helpers\Chart\MetaPieChartInterface;@@ -41,7 +39,6 @@ use Tests\TestCase;/*** Class BudgetReportControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -117,7 +114,6 @@ class BudgetReportControllerTest extends TestCase$budgetRepos->shouldReceive('getAllBudgetLimits')->andReturn(new Collection([$one, $two]))->once();-$collector->shouldReceive('setAccounts')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL, TransactionType::TRANSFER]])->andReturnSelf();@@ -134,5 +130,4 @@ class BudgetReportControllerTest extends TestCase$response = $this->get(route('chart.budget.main', ['1', '1', '20120101', '20120131', 0]));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Chart/CategoryControllerTest.php b/tests/Feature/Controllers/Chart/CategoryControllerTest.phpindex 205252883d..6b769488ab 100644--- a/tests/Feature/Controllers/Chart/CategoryControllerTest.php+++ b/tests/Feature/Controllers/Chart/CategoryControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use Carbon\Carbon;use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Models\Account;@@ -37,14 +35,12 @@ use Tests\TestCase;/*** Class CategoryControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class CategoryControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Chart\CategoryController::all* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::__construct@@ -64,7 +60,6 @@ class CategoryControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsByType')->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn(new Collection)->once();$generator->shouldReceive('multiSet')->once()->andReturn([]);-$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('chart.category.all', [1]));@@ -109,7 +104,6 @@ class CategoryControllerTest extends TestCase$repository->shouldReceive('periodIncome')->andReturn([])->once();$generator->shouldReceive('multiSet')->andReturn([])->once();-$this->be($this->user());$response = $this->get(route('chart.category.period', [1, '1', '20120101', '20120131']));$response->assertStatus(200);@@ -156,5 +150,4 @@ class CategoryControllerTest extends TestCase$response = $this->get(route('chart.category.specific', ['1', '2012-01-01']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php b/tests/Feature/Controllers/Chart/CategoryReportControllerTest.phpindex b146b34cd9..0e42d2d676 100644--- a/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php+++ b/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Helpers\Chart\MetaPieChartInterface;use FireflyIII\Helpers\Collector\JournalCollectorInterface;@@ -38,14 +36,12 @@ use Tests\TestCase;/*** Class CategoryReportControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class CategoryReportControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountExpense* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::__construct@@ -160,5 +156,4 @@ class CategoryReportControllerTest extends TestCase$response = $this->get(route('chart.category.main', ['1', '1', '20120101', '20120131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php b/tests/Feature/Controllers/Chart/PiggyBankControllerTest.phpindex a3284ad85d..7c32825474 100644--- a/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php+++ b/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Models\PiggyBankEvent;use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;@@ -33,7 +31,6 @@ use Tests\TestCase;/*** Class PiggyBankControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -57,6 +54,4 @@ class PiggyBankControllerTest extends TestCase$response = $this->get(route('chart.piggy-bank.history', [1]));$response->assertStatus(200);}--}diff --git a/tests/Feature/Controllers/Chart/ReportControllerTest.php b/tests/Feature/Controllers/Chart/ReportControllerTest.phpindex a562111eaf..c981cf020d 100644--- a/tests/Feature/Controllers/Chart/ReportControllerTest.php+++ b/tests/Feature/Controllers/Chart/ReportControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Repositories\Account\AccountTaskerInterface;use Steam;@@ -32,14 +30,12 @@ use Tests\TestCase;/*** Class ReportControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ReportControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Chart\ReportController::netWorth* @covers \FireflyIII\Http\Controllers\Chart\ReportController::arraySum@@ -96,5 +92,4 @@ class ReportControllerTest extends TestCase$response = $this->get(route('chart.report.sum', [1, '20120101', '20120131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Chart/TagReportControllerTest.php b/tests/Feature/Controllers/Chart/TagReportControllerTest.phpindex 1818e156d1..cc42efac37 100644--- a/tests/Feature/Controllers/Chart/TagReportControllerTest.php+++ b/tests/Feature/Controllers/Chart/TagReportControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;-use FireflyIII\Generator\Chart\Basic\GeneratorInterface;use FireflyIII\Helpers\Chart\MetaPieChartInterface;use FireflyIII\Helpers\Collector\JournalCollectorInterface;@@ -40,7 +38,6 @@ use Tests\TestCase;/*** Class TagReportControllerTest*- * @package Tests\Feature\Controllers\Chart* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -88,7 +85,6 @@ class TagReportControllerTest extends TestCase$this->be($this->user());$response = $this->get(route('chart.tag.account-income', ['1', 'housing', '20120101', '20120131', 0]));$response->assertStatus(200);-}/**@@ -144,16 +140,13 @@ class TagReportControllerTest extends TestCase$generator = $this->mock(GeneratorInterface::class);$collector = $this->mock(JournalCollectorInterface::class);$set = new Collection;- for ($i = 0; $i < 10; $i++) {--+ for ($i = 0; $i < 10; ++$i) {$transaction = factory(Transaction::class)->make();$tag = factory(Tag::class)->make();$transaction->transactionJournal->tags()->save($tag);$set->push($transaction);}-$collector->shouldReceive('setAccounts')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL, TransactionType::TRANSFER]])->andReturnSelf();@@ -213,6 +206,4 @@ class TagReportControllerTest extends TestCase$response = $this->get(route('chart.tag.tag-income', ['1', 'housing', '20120101', '20120131', 0]));$response->assertStatus(200);}--}diff --git a/tests/Feature/Controllers/CurrencyControllerTest.php b/tests/Feature/Controllers/CurrencyControllerTest.phpindex da3a394fc8..9e6edee8c2 100644--- a/tests/Feature/Controllers/CurrencyControllerTest.php+++ b/tests/Feature/Controllers/CurrencyControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -34,14 +33,12 @@ use Tests\TestCase;/*** Class CurrencyControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class CurrencyControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\CurrencyController::create*/@@ -73,7 +70,6 @@ class CurrencyControllerTest extends TestCase$repository->shouldReceive('canDeleteCurrency')->andReturn(false);$userRepos->shouldReceive('hasRole')->once()->andReturn(true);-$this->be($this->user());$response = $this->get(route('currencies.delete', [2]));$response->assertStatus(302);@@ -95,7 +91,6 @@ class CurrencyControllerTest extends TestCase$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$userRepos->shouldReceive('hasRole')->once()->andReturn(true);-$this->session(['currencies.delete.uri' => 'http://localhost']);$this->be($this->user());$response = $this->post(route('currencies.destroy', [1]));@@ -174,7 +169,6 @@ class CurrencyControllerTest extends TestCase$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$userRepos->shouldReceive('hasRole')->once()->andReturn(true);-$this->session(['currencies.delete.uri' => 'http://localhost']);$this->be($this->user());$response = $this->post(route('currencies.destroy', [1]));@@ -328,5 +322,4 @@ class CurrencyControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}-}diff --git a/tests/Feature/Controllers/ExportControllerTest.php b/tests/Feature/Controllers/ExportControllerTest.phpindex d4c8f23e71..57007bd546 100644--- a/tests/Feature/Controllers/ExportControllerTest.php+++ b/tests/Feature/Controllers/ExportControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -37,14 +36,12 @@ use Tests\TestCase;/*** Class ExportControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ExportControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\ExportController::download*/@@ -134,7 +131,6 @@ class ExportControllerTest extends TestCase['first' => new Carbon('2014-01-01')]);-$data = ['export_start_range' => '2015-01-01','export_end_range' => '2015-01-21',@@ -167,5 +163,4 @@ class ExportControllerTest extends TestCase$response->assertStatus(200);$response->assertSee('ok');}-}diff --git a/tests/Feature/Controllers/HelpControllerTest.php b/tests/Feature/Controllers/HelpControllerTest.phpindex e92d356bd3..3d0fb97476 100644--- a/tests/Feature/Controllers/HelpControllerTest.php+++ b/tests/Feature/Controllers/HelpControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -30,14 +29,12 @@ use Tests\TestCase;/*** Class HelpControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class HelpControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\HelpController::show* @covers \FireflyIII\Http\Controllers\HelpController::getHelpText@@ -65,7 +62,7 @@ class HelpControllerTest extends TestCase{// force pref in dutch for testPreference::where('user_id', $this->user()->id)->where('name', 'language')->delete();- Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL',]);+ Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL']);$help = $this->mock(HelpInterface::class);$help->shouldReceive('hasRoute')->withArgs(['index'])->andReturn(true)->once();@@ -83,7 +80,7 @@ class HelpControllerTest extends TestCase// put English back:Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();- Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US',]);+ Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US']);}/**@@ -94,7 +91,7 @@ class HelpControllerTest extends TestCase{// force pref in dutch for testPreference::where('user_id', $this->user()->id)->where('name', 'language')->delete();- Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL',]);+ Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL']);$help = $this->mock(HelpInterface::class);$help->shouldReceive('hasRoute')->withArgs(['index'])->andReturn(true)->once();@@ -112,7 +109,7 @@ class HelpControllerTest extends TestCase// put English back:Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();- Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US',]);+ Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US']);}/**@@ -146,5 +143,4 @@ class HelpControllerTest extends TestCase$response->assertStatus(200);$response->assertSee('There is no help for this route.');}-}diff --git a/tests/Feature/Controllers/HomeControllerTest.php b/tests/Feature/Controllers/HomeControllerTest.phpindex 39ac6ae8cb..225d40d96b 100644--- a/tests/Feature/Controllers/HomeControllerTest.php+++ b/tests/Feature/Controllers/HomeControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -36,7 +35,6 @@ use Tests\TestCase;/*** Class HomeControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -53,7 +51,6 @@ class HomeControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->be($this->user());$args = [@@ -76,7 +73,6 @@ class HomeControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->be($this->user());$args = [@@ -191,5 +187,4 @@ class HomeControllerTest extends TestCase$response->assertSessionHas('warning');$response->assertSessionHas('error');}-}diff --git a/tests/Feature/Controllers/Import/FileControllerTest.php b/tests/Feature/Controllers/Import/FileControllerTest.phpindex 21db04ef42..87bef0d6c2 100644--- a/tests/Feature/Controllers/Import/FileControllerTest.php+++ b/tests/Feature/Controllers/Import/FileControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Import;@@ -33,7 +32,6 @@ use Tests\TestCase;/*** Class FileControllerTest*- * @package Tests\Feature\Controllers\Import* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -54,7 +52,6 @@ class FileControllerTest extends TestCase$configurator->shouldReceive('getNextView')->once()->andReturn('import.csv.initial');$configurator->shouldReceive('getNextData')->andReturn(['specifics' => [], 'delimiters' => [], 'accounts' => []])->once();-$this->be($this->user());$response = $this->get(route('import.file.configure', ['configure']));$response->assertStatus(200);@@ -89,7 +86,6 @@ class FileControllerTest extends TestCase$response->assertStatus(200);}-/*** @covers \FireflyIII\Http\Controllers\Import\FileController::initialize*/@@ -156,7 +152,6 @@ class FileControllerTest extends TestCase$configurator->shouldReceive('configureJob')->once()->andReturn(false);$configurator->shouldReceive('getWarningMessage')->once()->andReturn('');-$this->be($this->user());$response = $this->post(route('import.file.process-configuration', ['running']));$response->assertStatus(302);@@ -172,7 +167,6 @@ class FileControllerTest extends TestCase$configurator->shouldReceive('setJob')->once();$configurator->shouldReceive('isJobConfigured')->once()->andReturn(true);-$this->be($this->user());$response = $this->post(route('import.file.process-configuration', ['running']));$response->assertStatus(302);@@ -188,7 +182,6 @@ class FileControllerTest extends TestCase$importer->shouldReceive('setJob')->once();$importer->shouldReceive('run')->once()->andReturn(true);-$this->be($this->user());$response = $this->post(route('import.file.start', ['running']));$response->assertStatus(200);@@ -204,7 +197,6 @@ class FileControllerTest extends TestCase$importer->shouldReceive('setJob')->once();$importer->shouldReceive('run')->once()->andReturn(false);-$this->be($this->user());$response = $this->post(route('import.file.start', ['running']));$response->assertStatus(500);@@ -230,5 +222,4 @@ class FileControllerTest extends TestCase$response->assertStatus(302);$response->assertRedirect(route('import.file.configure', ['new']));}-}diff --git a/tests/Feature/Controllers/ImportControllerTest.php b/tests/Feature/Controllers/ImportControllerTest.phpindex a79d4d1772..f85991ec4c 100644--- a/tests/Feature/Controllers/ImportControllerTest.php+++ b/tests/Feature/Controllers/ImportControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -28,14 +27,12 @@ use Tests\TestCase;/*** Class ImportControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ImportControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\ImportController::index*/@@ -46,6 +43,4 @@ class ImportControllerTest extends TestCase$response->assertStatus(200);$response->assertSee('<ol class="breadcrumb">');}--}diff --git a/tests/Feature/Controllers/JavascriptControllerTest.php b/tests/Feature/Controllers/JavascriptControllerTest.phpindex 207d6837a0..9085e5a987 100644--- a/tests/Feature/Controllers/JavascriptControllerTest.php+++ b/tests/Feature/Controllers/JavascriptControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -34,7 +33,6 @@ use Tests\TestCase;/*** Class JavascriptControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -83,12 +81,9 @@ class JavascriptControllerTest extends TestCase*/public function testVariables(string $range){--$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('javascript.variables'));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php b/tests/Feature/Controllers/Json/AutoCompleteControllerTest.phpindex 9ab71cb6b2..6d2379592a 100644--- a/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php+++ b/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Json;-use FireflyIII\Helpers\Collector\JournalCollectorInterface;use FireflyIII\Models\Account;use FireflyIII\Models\AccountType;@@ -35,13 +33,9 @@ use Tests\TestCase;/*** Class AutoCompleteControllerTest- *- * @package Tests\Feature\Controllers\Json*/class AutoCompleteControllerTest extends TestCase{--/*** @covers \FireflyIII\Http\Controllers\Json\AutoCompleteController::allAccounts*/@@ -131,5 +125,4 @@ class AutoCompleteControllerTest extends TestCase$response->assertStatus(200);$response->assertExactJson([]);}-}diff --git a/tests/Feature/Controllers/Json/ExchangeControllerTest.php b/tests/Feature/Controllers/Json/ExchangeControllerTest.phpindex 46e084aa87..3fc7a90688 100644--- a/tests/Feature/Controllers/Json/ExchangeControllerTest.php+++ b/tests/Feature/Controllers/Json/ExchangeControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Json;-use FireflyIII\Models\CurrencyExchangeRate;use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;use Tests\TestCase;@@ -31,14 +29,12 @@ use Tests\TestCase;/*** Class ExchangeControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ExchangeControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Json\ExchangeController::getRate*/diff --git a/tests/Feature/Controllers/JsonControllerTest.php b/tests/Feature/Controllers/JsonControllerTest.phpindex 510da9a313..6982cdb76a 100644--- a/tests/Feature/Controllers/JsonControllerTest.php+++ b/tests/Feature/Controllers/JsonControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -37,7 +36,6 @@ use Tests\TestCase;/*** Class JsonControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -93,7 +91,6 @@ class JsonControllerTest extends TestCase$response->assertExactJson([$category->name]);}-/*** @covers \FireflyIII\Http\Controllers\JsonController::tags*/@@ -141,5 +138,4 @@ class JsonControllerTest extends TestCase$response = $this->get(route('json.trigger'));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/NewUserControllerTest.php b/tests/Feature/Controllers/NewUserControllerTest.phpindex 9d5f8cc5d6..862491ae60 100644--- a/tests/Feature/Controllers/NewUserControllerTest.php+++ b/tests/Feature/Controllers/NewUserControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -31,14 +30,12 @@ use Tests\TestCase;/*** Class NewUserControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class NewUserControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\NewUserController::index* @covers \FireflyIII\Http\Controllers\NewUserController::__construct@@ -69,7 +66,6 @@ class NewUserControllerTest extends TestCase$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$accountRepos->shouldReceive('count')->andReturn(1);-$this->be($this->user());$response = $this->get(route('new-user.index'));$response->assertStatus(302);@@ -89,7 +85,6 @@ class NewUserControllerTest extends TestCase$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$accountRepos->shouldReceive('store')->times(2);-$data = ['bank_name' => 'New bank','savings_balance' => '1000',@@ -121,5 +116,4 @@ class NewUserControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}-}diff --git a/tests/Feature/Controllers/PiggyBankControllerTest.php b/tests/Feature/Controllers/PiggyBankControllerTest.phpindex 35d8dd6a39..ddbabebecc 100644--- a/tests/Feature/Controllers/PiggyBankControllerTest.php+++ b/tests/Feature/Controllers/PiggyBankControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -37,14 +36,12 @@ use Tests\TestCase;/*** Class PiggyBankControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class PiggyBankControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\PiggyBankController::add*/@@ -139,7 +136,6 @@ class PiggyBankControllerTest extends TestCase$repository->shouldReceive('destroy')->andReturn(true);-$this->session(['piggy-banks.delete.uri' => 'http://localhost']);$this->be($this->user());$response = $this->post(route('piggy-banks.destroy', [2]));@@ -240,7 +236,6 @@ class PiggyBankControllerTest extends TestCase$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$repository->shouldReceive('canAddAmount')->once()->andReturn(false);-$data = ['amount' => '1000'];$this->be($this->user());$response = $this->post(route('piggy-banks.add', [1]), $data);@@ -297,7 +292,6 @@ class PiggyBankControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->be($this->user());$response = $this->get(route('piggy-banks.remove', [1]));$response->assertStatus(200);@@ -352,7 +346,6 @@ class PiggyBankControllerTest extends TestCase'targetamount' => '100.123','account_id' => 2,'amount_currency_id_targetamount' => 1,-];$this->be($this->user());$response = $this->post(route('piggy-banks.store'), $data);@@ -378,7 +371,6 @@ class PiggyBankControllerTest extends TestCase'targetamount' => '100.123','account_id' => 2,'amount_currency_id_targetamount' => 1,-];$this->be($this->user());$response = $this->post(route('piggy-banks.update', [3]), $data);@@ -386,6 +378,4 @@ class PiggyBankControllerTest extends TestCase$response->assertSessionHas('success');$response->assertRedirect(route('index'));}--}diff --git a/tests/Feature/Controllers/Popup/ReportControllerTest.php b/tests/Feature/Controllers/Popup/ReportControllerTest.phpindex 44f4cd4206..43ab1bcf63 100644--- a/tests/Feature/Controllers/Popup/ReportControllerTest.php+++ b/tests/Feature/Controllers/Popup/ReportControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Popup;-use Carbon\Carbon;use FireflyIII\Helpers\Report\PopupReportInterface;use FireflyIII\Models\Account;@@ -35,18 +33,15 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;use Illuminate\Support\Collection;use Tests\TestCase;-/*** Class ReportControllerTest*- * @package Tests\Feature\Controllers\Popup* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ReportControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Popup\ReportController::__construct* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general@@ -176,7 +171,6 @@ class ReportControllerTest extends TestCase$budgetRepos = $this->mock(BudgetRepositoryInterface::class);$popupHelper = $this->mock(PopupReportInterface::class);-$budget = factory(Budget::class)->make();$account = factory(Account::class)->make();@@ -232,7 +226,6 @@ class ReportControllerTest extends TestCase],];-$uri = route('popup.general') . '?' . http_build_query($arguments);$response = $this->get($uri);$response->assertStatus(500);@@ -385,6 +378,4 @@ class ReportControllerTest extends TestCase$response = $this->get($uri);$response->assertStatus(500);}--}diff --git a/tests/Feature/Controllers/PreferencesControllerTest.php b/tests/Feature/Controllers/PreferencesControllerTest.phpindex 2a1f2bfa6d..5b2b075bf9 100644--- a/tests/Feature/Controllers/PreferencesControllerTest.php+++ b/tests/Feature/Controllers/PreferencesControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -36,14 +35,12 @@ use Tests\TestCase;/*** Class PreferencesControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class PreferencesControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\PreferencesController::code* @covers \FireflyIII\Http\Controllers\PreferencesController::getDomain@@ -231,5 +228,4 @@ class PreferencesControllerTest extends TestCase// go to code to get a secret.$response->assertRedirect(route('preferences.code'));}-}diff --git a/tests/Feature/Controllers/ProfileControllerTest.php b/tests/Feature/Controllers/ProfileControllerTest.phpindex 077d44b70c..072fc73152 100644--- a/tests/Feature/Controllers/ProfileControllerTest.php+++ b/tests/Feature/Controllers/ProfileControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -31,14 +30,12 @@ use Tests\TestCase;/*** Class ProfileControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ProfileControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\ProfileController::changePassword*/@@ -190,5 +187,4 @@ class ProfileControllerTest extends TestCase$response->assertRedirect(route('profile.delete-account'));$response->assertSessionHas('error');}-}diff --git a/tests/Feature/Controllers/Report/AccountControllerTest.php b/tests/Feature/Controllers/Report/AccountControllerTest.phpindex 3b75d0eb3c..848b390543 100644--- a/tests/Feature/Controllers/Report/AccountControllerTest.php+++ b/tests/Feature/Controllers/Report/AccountControllerTest.php@@ -18,19 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Report;-use FireflyIII\Repositories\Account\AccountTaskerInterface;use Tests\TestCase;/*** Class AccountControllerTest*- * @package Tests\Feature\Controllers\Report* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -52,10 +49,8 @@ class AccountControllerTest extends TestCase$tasker = $this->mock(AccountTaskerInterface::class);$tasker->shouldReceive('getAccountReport')->andReturn($return);-$this->be($this->user());$response = $this->get(route('report-data.account.general', ['1', '20120101', '20120131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Report/BalanceControllerTest.php b/tests/Feature/Controllers/Report/BalanceControllerTest.phpindex 48b65e7995..9cc9a35140 100644--- a/tests/Feature/Controllers/Report/BalanceControllerTest.php+++ b/tests/Feature/Controllers/Report/BalanceControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Report;-use FireflyIII\Helpers\Collection\Balance;use FireflyIII\Helpers\Report\BalanceReportHelperInterface;use Tests\TestCase;@@ -31,7 +29,6 @@ use Tests\TestCase;/*** Class BalanceControllerTest*- * @package Tests\Feature\Controllers\Report* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -50,5 +47,4 @@ class BalanceControllerTest extends TestCase$response = $this->get(route('report-data.balance.general', ['1', '20120101', '20120131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Report/BudgetControllerTest.php b/tests/Feature/Controllers/Report/BudgetControllerTest.phpindex bf13f2a624..3535c2a257 100644--- a/tests/Feature/Controllers/Report/BudgetControllerTest.php+++ b/tests/Feature/Controllers/Report/BudgetControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Report;-use FireflyIII\Helpers\Report\BudgetReportHelperInterface;use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use Illuminate\Support\Collection;@@ -32,7 +30,6 @@ use Tests\TestCase;/*** Class BudgetControllerTest*- * @package Tests\Feature\Controllers\Report* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -70,5 +67,4 @@ class BudgetControllerTest extends TestCase$response = $this->get(route('report-data.budget.period', ['1', '20120101', '20120131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Report/CategoryControllerTest.php b/tests/Feature/Controllers/Report/CategoryControllerTest.phpindex 1706e89c87..28131347ea 100644--- a/tests/Feature/Controllers/Report/CategoryControllerTest.php+++ b/tests/Feature/Controllers/Report/CategoryControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Report;-use FireflyIII\Models\Category;use FireflyIII\Repositories\Category\CategoryRepositoryInterface;use Illuminate\Support\Collection;@@ -32,7 +30,6 @@ use Tests\TestCase;/*** Class CategoryControllerTest*- * @package Tests\Feature\Controllers\Report* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -89,5 +86,4 @@ class CategoryControllerTest extends TestCase$response = $this->get(route('report-data.category.operations', ['1', '20120101', '20120131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/Report/OperationsControllerTest.php b/tests/Feature/Controllers/Report/OperationsControllerTest.phpindex 581113b1e7..e69822afd2 100644--- a/tests/Feature/Controllers/Report/OperationsControllerTest.php+++ b/tests/Feature/Controllers/Report/OperationsControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Report;-use FireflyIII\Helpers\Collector\JournalCollectorInterface;use FireflyIII\Helpers\Filter\InternalTransferFilter;use FireflyIII\Models\Transaction;@@ -33,7 +31,6 @@ use Tests\TestCase;/*** Class OperationsControllerTest*- * @package Tests\Feature\Controllers\Report* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -55,7 +52,6 @@ class OperationsControllerTest extends TestCase$collector->shouldReceive('addFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();$collector->shouldReceive('getJournals')->andReturn($transactions);-$this->be($this->user());$response = $this->get(route('report-data.operations.expenses', ['1', '20160101', '20160131']));$response->assertStatus(200);@@ -101,5 +97,4 @@ class OperationsControllerTest extends TestCase$response = $this->get(route('report-data.operations.operations', ['1', '20160101', '20160131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/ReportControllerTest.php b/tests/Feature/Controllers/ReportControllerTest.phpindex 613c87e0bb..f0a157dafb 100644--- a/tests/Feature/Controllers/ReportControllerTest.php+++ b/tests/Feature/Controllers/ReportControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;-use FireflyIII\Generator\Report\Audit\YearReportGenerator as AYRG;use FireflyIII\Generator\Report\Budget\YearReportGenerator as BYRG;use FireflyIII\Generator\Report\Category\YearReportGenerator as CYRG;@@ -46,14 +44,12 @@ use Tests\TestCase;/*** Class ReportControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class ReportControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\ReportController::auditReport*/@@ -68,7 +64,6 @@ class ReportControllerTest extends TestCase$generator->shouldReceive('setAccounts')->once();$generator->shouldReceive('generate')->andReturn('here-be-report')->once();-$this->be($this->user());$response = $this->get(route('reports.report.audit', [1, '20160101', '20160131']));$response->assertStatus(200);@@ -189,7 +184,6 @@ class ReportControllerTest extends TestCase$budget = factory(Budget::class)->make();$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection([$budget]));-$this->be($this->user());$response = $this->get(route('reports.options', ['budget']));$response->assertStatus(200);@@ -458,5 +452,4 @@ class ReportControllerTest extends TestCase$response = $this->get(route('reports.report.tag', [1, 'TagJanuary', '20160101', '20160131']));$response->assertStatus(200);}-}diff --git a/tests/Feature/Controllers/RuleControllerTest.php b/tests/Feature/Controllers/RuleControllerTest.phpindex 9983551385..65888e8a09 100644--- a/tests/Feature/Controllers/RuleControllerTest.php+++ b/tests/Feature/Controllers/RuleControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -37,14 +36,12 @@ use Tests\TestCase;/*** Class RuleControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class RuleControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\RuleController::create*/@@ -77,7 +74,6 @@ class RuleControllerTest extends TestCase];$this->session(['_old_input' => $old]);-// mock stuff$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);@@ -223,7 +219,7 @@ class RuleControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $data = ['actions' => [1, 2, 3],];+ $data = ['actions' => [1, 2, 3]];$repository->shouldReceive('reorderRuleActions')->once();$this->be($this->user());@@ -241,7 +237,7 @@ class RuleControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $data = ['triggers' => [1, 2, 3],];+ $data = ['triggers' => [1, 2, 3]];$repository->shouldReceive('reorderRuleTriggers')->once();$this->be($this->user());@@ -289,7 +285,6 @@ class RuleControllerTest extends TestCase}/**- ** @covers \FireflyIII\Http\Controllers\RuleController::testTriggers* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList*/@@ -419,5 +414,4 @@ class RuleControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}-}diff --git a/tests/Feature/Controllers/RuleGroupControllerTest.php b/tests/Feature/Controllers/RuleGroupControllerTest.phpindex b2a1c12503..527fad901e 100644--- a/tests/Feature/Controllers/RuleGroupControllerTest.php+++ b/tests/Feature/Controllers/RuleGroupControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -36,14 +35,12 @@ use Tests\TestCase;/*** Class RuleGroupControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class RuleGroupControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\RuleGroupController::create* @covers \FireflyIII\Http\Controllers\RuleGroupController::__construct@@ -122,7 +119,6 @@ class RuleGroupControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->be($this->user());$response = $this->get(route('rule-groups.edit', [1]));$response->assertStatus(200);@@ -191,7 +187,6 @@ class RuleGroupControllerTest extends TestCase'description' => 'No description',];-$this->be($this->user());$response = $this->post(route('rule-groups.store', [1]), $data);$response->assertStatus(302);@@ -239,5 +234,4 @@ class RuleGroupControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}-}diff --git a/tests/Feature/Controllers/SearchControllerTest.php b/tests/Feature/Controllers/SearchControllerTest.phpindex 70da309400..dea7fb08aa 100644--- a/tests/Feature/Controllers/SearchControllerTest.php+++ b/tests/Feature/Controllers/SearchControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -29,14 +28,12 @@ use Tests\TestCase;/*** Class SearchControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class SearchControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\SearchController::index* @covers \FireflyIII\Http\Controllers\SearchController::__construct@@ -51,5 +48,4 @@ class SearchControllerTest extends TestCase$response->assertStatus(200);$response->assertSee('<ol class="breadcrumb">');}-}diff --git a/tests/Feature/Controllers/TagControllerTest.php b/tests/Feature/Controllers/TagControllerTest.phpindex 0069ce7636..377a3518ca 100644--- a/tests/Feature/Controllers/TagControllerTest.php+++ b/tests/Feature/Controllers/TagControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -33,18 +32,15 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface;use Illuminate\Pagination\LengthAwarePaginator;use Tests\TestCase;-/*** Class TagControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class TagControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\TagController::create*/@@ -161,7 +157,6 @@ class TagControllerTest extends TestCase$collector->shouldReceive('setRange')->andReturnSelf()->once();$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();-$this->be($this->user());$response = $this->get(route('tags.show', [1]));$response->assertStatus(200);@@ -198,7 +193,6 @@ class TagControllerTest extends TestCase];$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();-$this->be($this->user());$response = $this->get(route('tags.show', [1, 'all']));$response->assertStatus(200);@@ -238,7 +232,6 @@ class TagControllerTest extends TestCase];$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();-$this->be($this->user());$response = $this->get(route('tags.show', [1, '2016-01-01']));$response->assertStatus(200);@@ -278,7 +271,6 @@ class TagControllerTest extends TestCase$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$this->session(['tags.edit.uri' => 'http://localhost']);$data = ['tag' => 'Hello updated tag' . rand(999, 10000),@@ -293,5 +285,4 @@ class TagControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionHas('success');}-}diff --git a/tests/Feature/Controllers/Transaction/ConvertControllerTest.php b/tests/Feature/Controllers/Transaction/ConvertControllerTest.phpindex 1d140e303a..ce260a5c2e 100644--- a/tests/Feature/Controllers/Transaction/ConvertControllerTest.php+++ b/tests/Feature/Controllers/Transaction/ConvertControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Transaction;-use DB;use FireflyIII\Models\Account;use FireflyIII\Models\AccountType;@@ -37,7 +35,6 @@ use Tests\TestCase;/*** Class ConvertControllerTest*- * @package Tests\Feature\Controllers\Transaction* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -217,7 +214,7 @@ class ConvertControllerTest extends TestCase$accountRepos->shouldReceive('store')->andReturn(new Account);$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();- $data = ['destination_account_expense' => 'New expense name.',];+ $data = ['destination_account_expense' => 'New expense name.'];$this->be($this->user());$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);$response->assertStatus(302);@@ -240,7 +237,7 @@ class ConvertControllerTest extends TestCase$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();- $data = ['destination_account_expense' => '',];+ $data = ['destination_account_expense' => ''];$this->be($this->user());$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);$response->assertStatus(302);@@ -261,7 +258,6 @@ class ConvertControllerTest extends TestCase$repository->shouldReceive('convert')->andReturn($messageBag);$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);-$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();$data = ['destination_account_asset' => 2,@@ -360,7 +356,7 @@ class ConvertControllerTest extends TestCase$accountRepos->shouldReceive('store')->andReturn(new Account)->once();$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();- $data = ['source_account_revenue' => 'New revenue name.',];+ $data = ['source_account_revenue' => 'New revenue name.'];$this->be($this->user());$response = $this->post(route('transactions.convert.index', ['deposit', $withdrawal->id]), $data);$response->assertStatus(302);@@ -383,7 +379,7 @@ class ConvertControllerTest extends TestCase$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();- $data = ['source_account_revenue' => '',];+ $data = ['source_account_revenue' => ''];$this->be($this->user());$response = $this->post(route('transactions.convert.index', ['deposit', $withdrawal->id]), $data);$response->assertStatus(302);@@ -414,6 +410,4 @@ class ConvertControllerTest extends TestCase$response->assertStatus(302);$response->assertRedirect(route('transactions.show', [$withdrawal->id]));}--}diff --git a/tests/Feature/Controllers/Transaction/MassControllerTest.php b/tests/Feature/Controllers/Transaction/MassControllerTest.phpindex a7be09f766..1c77ac17f9 100644--- a/tests/Feature/Controllers/Transaction/MassControllerTest.php+++ b/tests/Feature/Controllers/Transaction/MassControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Transaction;-use DB;use FireflyIII\Models\AccountType;use FireflyIII\Models\TransactionJournal;@@ -36,7 +34,6 @@ use Tests\TestCase;/*** Class MassControllerTest*- * @package Tests\Feature\Controllers\Transaction* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -193,7 +190,6 @@ class MassControllerTest extends TestCase$repository->shouldReceive('update')->once();$repository->shouldReceive('find')->once()->andReturn($deposit);-$this->session(['transactions.mass-edit.uri' => 'http://localhost']);$data = [diff --git a/tests/Feature/Controllers/Transaction/SingleControllerTest.php b/tests/Feature/Controllers/Transaction/SingleControllerTest.phpindex a78e15577a..2a89501f6f 100644--- a/tests/Feature/Controllers/Transaction/SingleControllerTest.php+++ b/tests/Feature/Controllers/Transaction/SingleControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Transaction;-use DB;use FireflyIII\Events\StoredTransactionJournal;use FireflyIII\Events\UpdatedTransactionJournal;@@ -45,14 +43,12 @@ use Tests\TestCase;/*** Class SingleControllerTest*- * @package Tests\Feature\Controllers\Transaction* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class SingleControllerTest extends TestCase{-/*** @covers \FireflyIII\Http\Controllers\Transaction\SingleController::cloneTransaction*/@@ -78,7 +74,6 @@ class SingleControllerTest extends TestCase$piggyRepos = $this->mock(PiggyBankRepositoryInterface::class);$piggyRepos->shouldReceive('getPiggyBanksWithAmount')->andReturn(new Collection)->once();-$this->be($this->user());$response = $this->get(route('transactions.create', ['withdrawal']));$response->assertStatus(200);@@ -206,7 +201,6 @@ class SingleControllerTest extends TestCase$response->assertStatus(302);}-/*** @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedAccountList@@ -317,14 +311,12 @@ class SingleControllerTest extends TestCase$messages = new MessageBag;$messages->add('attachments', 'Fake error');-// mock attachment helper, trigger an error AND and info thing.$attachmentRepo = $this->mock(AttachmentHelperInterface::class);$attachmentRepo->shouldReceive('saveAttachmentsForModel');$attachmentRepo->shouldReceive('getErrors')->andReturn($errors);$attachmentRepo->shouldReceive('getMessages')->andReturn($messages);-$this->session(['transactions.create.uri' => 'http://localhost']);$this->be($this->user());@@ -360,7 +352,6 @@ class SingleControllerTest extends TestCase$journal->description = 'New journal';$journal->transactionType()->associate($type);-$repository->shouldReceive('update')->andReturn($journal);$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);@@ -389,7 +380,5 @@ class SingleControllerTest extends TestCase$response->assertSee('Updated groceries');// has bread crumb$response->assertSee('<ol class="breadcrumb">');-}-}diff --git a/tests/Feature/Controllers/Transaction/SplitControllerTest.php b/tests/Feature/Controllers/Transaction/SplitControllerTest.phpindex 282416be3c..d9b18be2cc 100644--- a/tests/Feature/Controllers/Transaction/SplitControllerTest.php+++ b/tests/Feature/Controllers/Transaction/SplitControllerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers\Transaction;-use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;use FireflyIII\Models\AccountType;use FireflyIII\Models\Transaction;@@ -40,7 +38,6 @@ use Tests\TestCase;/*** Class SplitControllerTest*- * @package Tests\Feature\Controllers\Transaction* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -55,7 +52,6 @@ class SplitControllerTest extends TestCase*/public function testEdit(){-$currencyRepository = $this->mock(CurrencyRepositoryInterface::class);$accountRepository = $this->mock(AccountRepositoryInterface::class);$budgetRepository = $this->mock(BudgetRepositoryInterface::class);@@ -71,7 +67,6 @@ class SplitControllerTest extends TestCase$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);$tasker->shouldReceive('getTransactionsOverview')->andReturn($transactions->toArray());-$this->be($this->user());$response = $this->get(route('transactions.split.edit', [$deposit->id]));$response->assertStatus(200);@@ -98,7 +93,6 @@ class SplitControllerTest extends TestCase*/public function testEditSingle(){-$currencyRepository = $this->mock(CurrencyRepositoryInterface::class);$accountRepository = $this->mock(AccountRepositoryInterface::class);$budgetRepository = $this->mock(BudgetRepositoryInterface::class);@@ -114,7 +108,6 @@ class SplitControllerTest extends TestCase$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);$tasker->shouldReceive('getTransactionsOverview')->andReturn($transactions->toArray());-$this->be($this->user());$response = $this->get(route('transactions.split.edit', [$deposit->id]));$response->assertStatus(200);@@ -158,7 +151,6 @@ class SplitControllerTest extends TestCase$repository->shouldReceive('updateSplitJournal')->andReturn($deposit);$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);-$attachmentRepos = $this->mock(AttachmentHelperInterface::class);$attachmentRepos->shouldReceive('saveAttachmentsForModel');$attachmentRepos->shouldReceive('getMessages')->andReturn(new MessageBag);@@ -191,5 +183,4 @@ class SplitControllerTest extends TestCase$response->assertStatus(302);$response->assertSessionMissing('success');}-}diff --git a/tests/Feature/Controllers/TransactionControllerTest.php b/tests/Feature/Controllers/TransactionControllerTest.phpindex fbcee31207..82208b6e1a 100644--- a/tests/Feature/Controllers/TransactionControllerTest.php+++ b/tests/Feature/Controllers/TransactionControllerTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -36,15 +35,12 @@ use Tests\TestCase;/*** Class TransactionControllerTest*- * @package Tests\Feature\Controllers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/class TransactionControllerTest extends TestCase{--/*** @covers \FireflyIII\Http\Controllers\TransactionController::index* @covers \FireflyIII\Http\Controllers\TransactionController::__construct@@ -254,5 +250,4 @@ class TransactionControllerTest extends TestCase$response = $this->get(route('transactions.show', [$journal->id]));$response->assertStatus(302);}-}diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.phpindex 910ea86035..ab678fd27f 100644--- a/tests/Feature/ExampleTest.php+++ b/tests/Feature/ExampleTest.php@@ -18,10 +18,8 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);-namespace Tests\Feature;use Tests\TestCase;@@ -30,8 +28,6 @@ class ExampleTest extends TestCase{/*** A basic test example.- *- * @return void*/public function testBasicTest(){diff --git a/tests/TestCase.php b/tests/TestCase.phpindex 4d3703c7dd..654d05a173 100644--- a/tests/TestCase.php+++ b/tests/TestCase.php@@ -19,7 +19,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests;@@ -34,7 +33,6 @@ use Mockery;/*** Class TestCase*- * @package Tests* @SuppressWarnings(PHPMD.NumberOfChildren)*/abstract class TestCase extends BaseTestCase@@ -58,9 +56,8 @@ abstract class TestCase extends BaseTestCase]);// set period to match?-}- if ($range === 'custom') {+ if ('custom' === $range) {$this->session(['start' => Carbon::now()->subDays(20),@@ -119,5 +116,4 @@ abstract class TestCase extends BaseTestCasereturn $object;}-}diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.phpindex 72011a9b73..9e4aee9865 100644--- a/tests/Unit/ExampleTest.php+++ b/tests/Unit/ExampleTest.php@@ -18,10 +18,8 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);-namespace Tests\Unit;use Tests\TestCase;@@ -30,8 +28,6 @@ class ExampleTest extends TestCase{/*** A basic test example.- *- * @return void*/public function testBasicTest(){diff --git a/tests/Unit/Handlers/Events/UserEventHandlerTest.php b/tests/Unit/Handlers/Events/UserEventHandlerTest.phpindex 8e68e3967e..823fd8cc3e 100644--- a/tests/Unit/Handlers/Events/UserEventHandlerTest.php+++ b/tests/Unit/Handlers/Events/UserEventHandlerTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\Handlers\Events;-use FireflyIII\Events\RegisteredUser;use FireflyIII\Events\RequestedNewPassword;use FireflyIII\Handlers\Events\UserEventHandler;@@ -36,7 +34,6 @@ use Tests\TestCase;/*** Class UserEventHandlerTest*- * @package Tests\Unit\Handlers\Events* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -76,7 +73,7 @@ class UserEventHandlerTest extends TestCaseMail::assertSent(RequestedNewPasswordMail::class, function ($mail) use ($user) {- return $mail->hasTo($user->email) && $mail->ipAddress === '127.0.0.1';+ return $mail->hasTo($user->email) && '127.0.0.1' === $mail->ipAddress;});@@ -99,11 +96,10 @@ class UserEventHandlerTest extends TestCase// must send user an email:Mail::assertSent(RegisteredUserMail::class, function ($mail) use ($user) {- return $mail->hasTo($user->email) && $mail->ipAddress === '127.0.0.1';+ return $mail->hasTo($user->email) && '127.0.0.1' === $mail->ipAddress;});$this->assertTrue(true);}-}diff --git a/tests/Unit/Helpers/AttachmentHelperTest.php b/tests/Unit/Helpers/AttachmentHelperTest.phpindex 365043633d..428abcb83b 100644--- a/tests/Unit/Helpers/AttachmentHelperTest.php+++ b/tests/Unit/Helpers/AttachmentHelperTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\Helpers;-use FireflyIII\Helpers\Attachments\AttachmentHelper;use FireflyIII\Models\Attachment;use FireflyIII\Models\TransactionJournal;@@ -34,7 +32,6 @@ use Tests\TestCase;/*** Class AttachmentHelperTest*- * @package Tests\Unit\Helpers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -63,7 +60,6 @@ class AttachmentHelperTest extends TestCase* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::hasFile* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors- **/public function testInvalidMime(){@@ -93,7 +89,6 @@ class AttachmentHelperTest extends TestCase* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachments- **/public function testSave(){@@ -129,7 +124,6 @@ class AttachmentHelperTest extends TestCase* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachments- **/public function testSaveSecond(){@@ -146,6 +140,4 @@ class AttachmentHelperTest extends TestCase$this->assertCount(0, $messages);$this->assertEquals('Uploaded file "apple-touch-icon.png" is already attached to this object.', $errors->first());}--}diff --git a/tests/Unit/Helpers/MetaPieChartTest.php b/tests/Unit/Helpers/MetaPieChartTest.phpindex 634f912189..2307f88829 100644--- a/tests/Unit/Helpers/MetaPieChartTest.php+++ b/tests/Unit/Helpers/MetaPieChartTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\Helpers;-use Carbon\Carbon;use FireflyIII\Helpers\Chart\MetaPieChart;use FireflyIII\Helpers\Collector\JournalCollectorInterface;@@ -40,7 +38,6 @@ use Tests\TestCase;/*** Class MetaPieChartTest*- * @package Tests\Unit\Helpers* @SuppressWarnings(PHPMD.TooManyPublicMethods)* @SuppressWarnings(PHPMD.ExcessiveMethodLength)* @SuppressWarnings(PHPMD.CouplingBetweenObjects)@@ -87,7 +84,6 @@ class MetaPieChartTest extends TestCase$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);$accountRepos->shouldReceive('find')->withArgs([2])->andReturn($accounts[2]);-$helper = new MetaPieChart();$helper->setUser($this->user());$helper->setStart($som);@@ -98,12 +94,10 @@ class MetaPieChartTest extends TestCase$keys = array_keys($chart);$this->assertEquals($keys[0], $accounts[1]->name);$this->assertEquals($keys[1], $accounts[2]->name);- $this->assertTrue(bccomp('1000', $chart[$accounts[1]->name]) === 0);- $this->assertTrue(bccomp('1000', $chart[$accounts[2]->name]) === 0);+ $this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));+ $this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));$this->assertTrue(true);--}/**@@ -149,7 +143,6 @@ class MetaPieChartTest extends TestCase$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);$accountRepos->shouldReceive('find')->withArgs([2])->andReturn($accounts[2]);-$helper = new MetaPieChart();$helper->setCollectOtherObjects(true);$helper->setUser($this->user());@@ -161,20 +154,18 @@ class MetaPieChartTest extends TestCase$keys = array_keys($chart);$this->assertEquals($keys[0], $accounts[1]->name);$this->assertEquals($keys[1], $accounts[2]->name);- $this->assertTrue(bccomp('1000', $chart[$accounts[1]->name]) === 0);- $this->assertTrue(bccomp('1000', $chart[$accounts[2]->name]) === 0);- $this->assertTrue(bccomp('1000', $chart['Everything else']) === 0);+ $this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));+ $this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));+ $this->assertTrue(0 === bccomp('1000', $chart['Everything else']));$this->assertTrue(true);--}private function fakeOthers(): Collection{$set = new Collection;- for ($i = 0; $i < 30; $i++) {+ for ($i = 0; $i < 30; ++$i) {$transaction = new Transaction;// basic fields.@@ -193,7 +184,7 @@ class MetaPieChartTest extends TestCaseprivate function fakeTransactions(): Collection{$set = new Collection;- for ($i = 0; $i < 10; $i++) {+ for ($i = 0; $i < 10; ++$i) {$transaction = new Transaction;// basic fields.@@ -206,7 +197,7 @@ class MetaPieChartTest extends TestCase$set->push($transaction);}- for ($i = 0; $i < 10; $i++) {+ for ($i = 0; $i < 10; ++$i) {$transaction = new Transaction;// basic fields.@@ -221,5 +212,4 @@ class MetaPieChartTest extends TestCasereturn $set;}-}diff --git a/tests/Unit/Import/Converter/AmountTest.php b/tests/Unit/Import/Converter/AmountTest.phpindex 7209e3857d..c9e6b6a05d 100644--- a/tests/Unit/Import/Converter/AmountTest.php+++ b/tests/Unit/Import/Converter/AmountTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\Import\Converter;@@ -28,8 +27,6 @@ use Tests\TestCase;/*** Class AmountTest- *- * @package Tests\Unit\Import\Converter*/class AmountTest extends TestCase{@@ -83,12 +80,11 @@ class AmountTest extends TestCase'1.234' => '1234','1.234,5' => '1234.5','1.234,56' => '1234.56',-];foreach ($values as $value => $expected) {$converter = new Amount;$result = $converter->convert($value);- $this->assertEquals($expected, $result,sprintf('The original value was %s', $value));+ $this->assertEquals($expected, $result, sprintf('The original value was %s', $value));}}@@ -101,6 +97,4 @@ class AmountTest extends TestCase$result = $converter->convert(null);$this->assertEquals('0', $result);}--}diff --git a/tests/Unit/TransactionRules/Actions/AddTagTest.php b/tests/Unit/TransactionRules/Actions/AddTagTest.phpindex efef89e0f9..35aa2e12cf 100644--- a/tests/Unit/TransactionRules/Actions/AddTagTest.php+++ b/tests/Unit/TransactionRules/Actions/AddTagTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\Tag;use FireflyIII\Models\TransactionJournal;@@ -46,7 +44,6 @@ class AddTagTest extends TestCase$result = $action->act($journal);$this->assertFalse($result);$this->assertDatabaseHas('tag_transaction_journal', ['tag_id' => 2, 'transaction_journal_id' => 1]);-}/**@@ -64,7 +61,5 @@ class AddTagTest extends TestCase// find newly created tag:$tag = Tag::orderBy('id', 'DESC')->first();$this->assertDatabaseHas('tag_transaction_journal', ['tag_id' => $tag->id, 'transaction_journal_id' => 1]);-}-}diff --git a/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php b/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.phpindex bd8d0742be..c349c688bd 100644--- a/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php+++ b/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Actions\AppendDescription;@@ -48,7 +46,5 @@ class AppendDescriptionTest extends TestCase$journal = TransactionJournal::find(1);$this->assertEquals($oldDescription . 'APPEND', $journal->description);-}-}diff --git a/tests/Unit/TransactionRules/Actions/AppendNotesTest.php b/tests/Unit/TransactionRules/Actions/AppendNotesTest.phpindex 422700a136..1f0779dfdd 100644--- a/tests/Unit/TransactionRules/Actions/AppendNotesTest.php+++ b/tests/Unit/TransactionRules/Actions/AppendNotesTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\Note;use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;@@ -32,8 +30,6 @@ use Tests\TestCase;/*** Class AppendNotesTest- *- * @package Tests\Unit\TransactionRules\Actions*/class AppendNotesTest extends TestCase{@@ -64,7 +60,6 @@ class AppendNotesTest extends TestCase$newNote = $journal->notes()->first();$this->assertEquals($start . $toAppend, $newNote->text);-}/**@@ -90,6 +85,5 @@ class AppendNotesTest extends TestCase$newNote = $journal->notes()->first();$this->assertEquals($toAppend, $newNote->text);-}}diff --git a/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php b/tests/Unit/TransactionRules/Actions/ClearBudgetTest.phpindex 43c280cfd7..690b64f762 100644--- a/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php+++ b/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Actions\ClearBudget;@@ -31,8 +29,6 @@ use Tests\TestCase;/*** Class ClearBudgetTest- *- * @package Tests\Unit\TransactionRules\Actions*/class ClearBudgetTest extends TestCase{@@ -57,6 +53,5 @@ class ClearBudgetTest extends TestCase// assert result$this->assertEquals(0, $journal->budgets()->count());-}}diff --git a/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php b/tests/Unit/TransactionRules/Actions/ClearCategoryTest.phpindex fbee3211df..090fdd52db 100644--- a/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php+++ b/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;@@ -30,8 +29,6 @@ use Tests\TestCase;/*** Class ClearCategoryTest- *- * @package Tests\Unit\TransactionRules\Actions*/class ClearCategoryTest extends TestCase{@@ -56,6 +53,5 @@ class ClearCategoryTest extends TestCase// assert result$this->assertEquals(0, $journal->categories()->count());-}}diff --git a/tests/Unit/TransactionRules/Actions/ClearNotesTest.php b/tests/Unit/TransactionRules/Actions/ClearNotesTest.phpindex a9a4d70cd1..24909215a4 100644--- a/tests/Unit/TransactionRules/Actions/ClearNotesTest.php+++ b/tests/Unit/TransactionRules/Actions/ClearNotesTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\Note;use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;@@ -32,8 +30,6 @@ use Tests\TestCase;/*** Class ClearNotesTest- *- * @package Tests\Unit\TransactionRules\Actions*/class ClearNotesTest extends TestCase{@@ -63,6 +59,5 @@ class ClearNotesTest extends TestCase// assert result$this->assertEquals(0, $journal->notes()->count());-}}diff --git a/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php b/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.phpindex 850ecf8c79..6a38815ee8 100644--- a/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php+++ b/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Actions\PrependDescription;@@ -31,8 +29,6 @@ use Tests\TestCase;/*** Class PrependDescriptionTest- *- * @package Tests\Unit\TransactionRules\Actions*/class PrependDescriptionTest extends TestCase{@@ -59,6 +55,5 @@ class PrependDescriptionTest extends TestCase// assert result$this->assertEquals($prepend . $description, $journal->description);-}}diff --git a/tests/Unit/TransactionRules/Actions/PrependNotesTest.php b/tests/Unit/TransactionRules/Actions/PrependNotesTest.phpindex 22fd94a7b3..2ebeb629a7 100644--- a/tests/Unit/TransactionRules/Actions/PrependNotesTest.php+++ b/tests/Unit/TransactionRules/Actions/PrependNotesTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\Note;use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;@@ -32,8 +30,6 @@ use Tests\TestCase;/*** Class PrependNotesTest- *- * @package Tests\Unit\TransactionRules\Actions*/class PrependNotesTest extends TestCase{@@ -64,7 +60,6 @@ class PrependNotesTest extends TestCase$newNote = $journal->notes()->first();$this->assertEquals($toPrepend . $start, $newNote->text);-}/**@@ -90,6 +85,5 @@ class PrependNotesTest extends TestCase$newNote = $journal->notes()->first();$this->assertEquals($toPrepend, $newNote->text);-}}diff --git a/tests/Unit/TransactionRules/Actions/RemoveAllTagsTest.php b/tests/Unit/TransactionRules/Actions/RemoveAllTagsTest.phpindex 049abaabcb..2a0f961329 100644--- a/tests/Unit/TransactionRules/Actions/RemoveAllTagsTest.php+++ b/tests/Unit/TransactionRules/Actions/RemoveAllTagsTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Actions\RemoveAllTags;@@ -31,8 +29,6 @@ use Tests\TestCase;/*** Class RemoveAllTagsTest- *- * @package Tests\Unit\TransactionRules\Actions*/class RemoveAllTagsTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Actions/RemoveTagTest.php b/tests/Unit/TransactionRules/Actions/RemoveTagTest.phpindex a4134f9aa3..b76f81f4f3 100644--- a/tests/Unit/TransactionRules/Actions/RemoveTagTest.php+++ b/tests/Unit/TransactionRules/Actions/RemoveTagTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Actions\RemoveTag;@@ -31,8 +29,6 @@ use Tests\TestCase;/*** Class RemoveTagTest- *- * @package Tests\Unit\TransactionRules\Actions*/class RemoveTagTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Actions/SetBudgetTest.php b/tests/Unit/TransactionRules/Actions/SetBudgetTest.phpindex e18620b0aa..1862ad11c6 100644--- a/tests/Unit/TransactionRules/Actions/SetBudgetTest.php+++ b/tests/Unit/TransactionRules/Actions/SetBudgetTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Actions\SetBudget;@@ -31,8 +29,6 @@ use Tests\TestCase;/*** Class SetBudgetTest- *- * @package Tests\Unit\TransactionRules\Actions*/class SetBudgetTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Actions/SetCategoryTest.php b/tests/Unit/TransactionRules/Actions/SetCategoryTest.phpindex db655a4896..face2ce0c8 100644--- a/tests/Unit/TransactionRules/Actions/SetCategoryTest.php+++ b/tests/Unit/TransactionRules/Actions/SetCategoryTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;@@ -30,8 +29,6 @@ use Tests\TestCase;/*** Class SetCategoryTest- *- * @package Tests\Unit\TransactionRules\Actions*/class SetCategoryTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Actions/SetDescriptionTest.php b/tests/Unit/TransactionRules/Actions/SetDescriptionTest.phpindex f51bed01f7..43f900a2dd 100644--- a/tests/Unit/TransactionRules/Actions/SetDescriptionTest.php+++ b/tests/Unit/TransactionRules/Actions/SetDescriptionTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;@@ -30,8 +29,6 @@ use Tests\TestCase;/*** Class SetDescriptionTest- *- * @package Tests\Unit\TransactionRules\Actions*/class SetDescriptionTest extends TestCase{@@ -58,6 +55,5 @@ class SetDescriptionTest extends TestCase// assert result$this->assertEquals($newDescription, $journal->description);-}}diff --git a/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php b/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.phpindex dabee5609e..f081af1171 100644--- a/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php+++ b/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use DB;use FireflyIII\Models\AccountType;use FireflyIII\Models\RuleAction;@@ -37,8 +35,6 @@ use Tests\TestCase;* Try split journal** Class SetDestinationAccountTest- *- * @package Tests\Unit\TransactionRules\Actions*/class SetDestinationAccountTest extends TestCase{@@ -183,5 +179,4 @@ class SetDestinationAccountTest extends TestCase$result = $action->act($journal);$this->assertFalse($result);}-}diff --git a/tests/Unit/TransactionRules/Actions/SetNotesTest.php b/tests/Unit/TransactionRules/Actions/SetNotesTest.phpindex 63884197b7..48c43be93d 100644--- a/tests/Unit/TransactionRules/Actions/SetNotesTest.php+++ b/tests/Unit/TransactionRules/Actions/SetNotesTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;-use FireflyIII\Models\Note;use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;@@ -32,8 +30,6 @@ use Tests\TestCase;/*** Class SetNotesTest- *- * @package Tests\Unit\TransactionRules\Actions*/class SetNotesTest extends TestCase{@@ -64,7 +60,6 @@ class SetNotesTest extends TestCase// assert result$this->assertEquals(1, $journal->notes()->count());$this->assertEquals($note->id, $journal->notes()->first()->id);-}/**diff --git a/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.php b/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.phpindex 5aeb47ecf3..bbd6be0ddf 100644--- a/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.php+++ b/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Actions;@@ -34,8 +33,6 @@ use Tests\TestCase;/*** Class SetSourceAccountTest- *- * @package Tests\Unit\TransactionRules\Actions*/class SetSourceAccountTest extends TestCase{@@ -180,5 +177,4 @@ class SetSourceAccountTest extends TestCase$result = $action->act($journal);$this->assertFalse($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/AmountExactlyTest.php b/tests/Unit/TransactionRules/Triggers/AmountExactlyTest.phpindex 99a350d3aa..e1d392af5a 100644--- a/tests/Unit/TransactionRules/Triggers/AmountExactlyTest.php+++ b/tests/Unit/TransactionRules/Triggers/AmountExactlyTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\AmountExactly;use Tests\TestCase;/*** Class AmountExactlyTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class AmountExactlyTest extends TestCase{@@ -78,6 +74,4 @@ class AmountExactlyTest extends TestCase$result = AmountExactly::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/AmountLessTest.php b/tests/Unit/TransactionRules/Triggers/AmountLessTest.phpindex b2dc9c3d0f..dc7fe6e738 100644--- a/tests/Unit/TransactionRules/Triggers/AmountLessTest.php+++ b/tests/Unit/TransactionRules/Triggers/AmountLessTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\AmountLess;use Tests\TestCase;/*** Class AmountLessTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class AmountLessTest extends TestCase{@@ -90,6 +86,4 @@ class AmountLessTest extends TestCase$result = AmountLess::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/AmountMoreTest.php b/tests/Unit/TransactionRules/Triggers/AmountMoreTest.phpindex 55673f2f75..6e5aaae43e 100644--- a/tests/Unit/TransactionRules/Triggers/AmountMoreTest.php+++ b/tests/Unit/TransactionRules/Triggers/AmountMoreTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\AmountMore;use Tests\TestCase;/*** Class AmountMoreTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class AmountMoreTest extends TestCase{@@ -100,6 +96,4 @@ class AmountMoreTest extends TestCase$result = AmountMore::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/BudgetIsTest.php b/tests/Unit/TransactionRules/Triggers/BudgetIsTest.phpindex db67250d12..dd6492a1ce 100644--- a/tests/Unit/TransactionRules/Triggers/BudgetIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/BudgetIsTest.php@@ -18,24 +18,19 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\BudgetIs;use Tests\TestCase;/*** Class BudgetIsTest- *- * @package Unit\TransactionRules\Triggers*/class BudgetIsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::triggered*/@@ -64,7 +59,6 @@ class BudgetIsTest extends TestCase$journal->budgets()->save($budget);$this->assertEquals(1, $journal->budgets()->count());-$trigger = BudgetIs::makeFromStrings($otherBudget->name, false);$result = $trigger->triggered($journal);$this->assertFalse($result);@@ -84,7 +78,6 @@ class BudgetIsTest extends TestCase$this->assertEquals(0, $journal->budgets()->count());$this->assertEquals(1, $transaction->budgets()->count());-$trigger = BudgetIs::makeFromStrings($budget->name, false);$result = $trigger->triggered($journal);$this->assertTrue($result);diff --git a/tests/Unit/TransactionRules/Triggers/CategoryIsTest.php b/tests/Unit/TransactionRules/Triggers/CategoryIsTest.phpindex 9d52e1529b..5bd9859bc1 100644--- a/tests/Unit/TransactionRules/Triggers/CategoryIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/CategoryIsTest.php@@ -18,24 +18,19 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\CategoryIs;use Tests\TestCase;/*** Class CategoryIsTest- *- * @package Unit\TransactionRules\Triggers*/class CategoryIsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::triggered*/@@ -64,7 +59,6 @@ class CategoryIsTest extends TestCase$journal->categories()->save($category);$this->assertEquals(1, $journal->categories()->count());-$trigger = CategoryIs::makeFromStrings($otherCategory->name, false);$result = $trigger->triggered($journal);$this->assertFalse($result);@@ -84,7 +78,6 @@ class CategoryIsTest extends TestCase$this->assertEquals(0, $journal->categories()->count());$this->assertEquals(1, $transaction->categories()->count());-$trigger = CategoryIs::makeFromStrings($category->name, false);$result = $trigger->triggered($journal);$this->assertTrue($result);diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.phpindex b937835cb3..896527b112 100644--- a/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php+++ b/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\DescriptionContains;use Tests\TestCase;/*** Class DescriptionContains- *- * @package Tests\Unit\TransactionRules\Triggers*/class DescriptionContainsTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.phpindex 10aa263264..2d07faa73b 100644--- a/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php+++ b/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\DescriptionEnds;use Tests\TestCase;/*** Class DescriptionEnds- *- * @package Tests\Unit\TransactionRules\Triggers*/class DescriptionEndsTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.phpindex 0a8d24ba2c..164a5767ae 100644--- a/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\DescriptionIs;use Tests\TestCase;/*** Class DescriptionIs- *- * @package Tests\Unit\TransactionRules\Triggers*/class DescriptionIsTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.phpindex a2e5faba0e..7b68b07e1a 100644--- a/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php+++ b/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php@@ -18,20 +18,16 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\DescriptionStarts;use Tests\TestCase;/*** Class DescriptionStarts- *- * @package Tests\Unit\TransactionRules\Triggers*/class DescriptionStartsTest extends TestCase{diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.phpindex a8c5a9f929..83f90f75d1 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class FromAccountContainsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class FromAccountContainsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::triggered*/@@ -90,6 +86,4 @@ class FromAccountContainsTest extends TestCase$result = FromAccountContains::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.phpindex 1a864cbed5..5f1e3b336b 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class FromAccountEndsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class FromAccountEndsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::triggered*/@@ -104,6 +100,4 @@ class FromAccountEndsTest extends TestCase$result = FromAccountEnds::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.phpindex 42f2228024..bdcc5c09c6 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class FromAccountIsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class FromAccountIsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::triggered*/@@ -49,7 +45,6 @@ class FromAccountIsTest extends TestCase$this->assertTrue($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::triggered*/@@ -91,5 +86,4 @@ class FromAccountIsTest extends TestCase$result = FromAccountIs::willMatchEverything($value);$this->assertTrue($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.phpindex d7bd8883a5..3d6f3315e4 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class FromAccountStartsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class FromAccountStartsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::triggered*/@@ -104,6 +100,4 @@ class FromAccountStartsTest extends TestCase$result = FromAccountStarts::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/HasAnyBudgetTest.php b/tests/Unit/TransactionRules/Triggers/HasAnyBudgetTest.phpindex c9d6523624..6eb7be68b8 100644--- a/tests/Unit/TransactionRules/Triggers/HasAnyBudgetTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasAnyBudgetTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,8 +28,6 @@ use Tests\TestCase;/*** Class HasAnyBudgetTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class HasAnyBudgetTest extends TestCase{@@ -76,7 +73,7 @@ class HasAnyBudgetTest extends TestCase// append to transactionforeach ($journal->transactions()->get() as $index => $transaction) {$transaction->budgets()->detach();- if ($index === 0) {+ if (0 === $index) {$transaction->budgets()->save($budget);}}@@ -95,5 +92,4 @@ class HasAnyBudgetTest extends TestCase$result = HasAnyBudget::willMatchEverything($value);$this->assertFalse($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/HasAnyCategoryTest.php b/tests/Unit/TransactionRules/Triggers/HasAnyCategoryTest.phpindex 510adcb94b..9dc9dcbc3b 100644--- a/tests/Unit/TransactionRules/Triggers/HasAnyCategoryTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasAnyCategoryTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,8 +28,6 @@ use Tests\TestCase;/*** Class HasAnyCategoryTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class HasAnyCategoryTest extends TestCase{@@ -76,7 +73,7 @@ class HasAnyCategoryTest extends TestCase// append to transactionforeach ($journal->transactions()->get() as $index => $transaction) {$transaction->categories()->detach();- if ($index === 0) {+ if (0 === $index) {$transaction->categories()->save($category);}}@@ -95,5 +92,4 @@ class HasAnyCategoryTest extends TestCase$result = HasAnyCategory::willMatchEverything($value);$this->assertFalse($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php b/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.phpindex 6226e386a7..5de12e60c6 100644--- a/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,8 +28,6 @@ use Tests\TestCase;/*** Class HasAnyTagTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class HasAnyTagTest extends TestCase{@@ -72,5 +69,4 @@ class HasAnyTagTest extends TestCase$result = HasAnyTag::willMatchEverything($value);$this->assertFalse($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/HasAttachmentTest.php b/tests/Unit/TransactionRules/Triggers/HasAttachmentTest.phpindex d7af365717..c29cafd3b1 100644--- a/tests/Unit/TransactionRules/Triggers/HasAttachmentTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasAttachmentTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,8 +28,6 @@ use Tests\TestCase;/*** Class HasAttachmentTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class HasAttachmentTest extends TestCase{@@ -81,5 +78,4 @@ class HasAttachmentTest extends TestCase$result = HasAttachment::willMatchEverything($value);$this->assertTrue($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/HasNoBudgetTest.php b/tests/Unit/TransactionRules/Triggers/HasNoBudgetTest.phpindex 27a3634339..bcd8da3470 100644--- a/tests/Unit/TransactionRules/Triggers/HasNoBudgetTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasNoBudgetTest.php@@ -18,24 +18,19 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\HasNoBudget;use Tests\TestCase;/*** Class HasNoBudgetTest- *- * @package Unit\TransactionRules\Triggers*/class HasNoBudgetTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\HasNoBudget::triggered*/@@ -61,7 +56,6 @@ class HasNoBudgetTest extends TestCase$journal->budgets()->detach();$this->assertEquals(0, $journal->budgets()->count());-$trigger = HasNoBudget::makeFromStrings('', false);$result = $trigger->triggered($journal);$this->assertTrue($result);@@ -81,7 +75,6 @@ class HasNoBudgetTest extends TestCase$this->assertEquals(0, $journal->budgets()->count());$this->assertEquals(1, $transaction->budgets()->count());-$trigger = HasNoBudget::makeFromStrings('', false);$result = $trigger->triggered($journal);$this->assertFalse($result);diff --git a/tests/Unit/TransactionRules/Triggers/HasNoCategoryTest.php b/tests/Unit/TransactionRules/Triggers/HasNoCategoryTest.phpindex 911c9384ab..71e28252e2 100644--- a/tests/Unit/TransactionRules/Triggers/HasNoCategoryTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasNoCategoryTest.php@@ -18,24 +18,19 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\HasNoCategory;use Tests\TestCase;/*** Class HasNoCategoryTest- *- * @package Unit\TransactionRules\Triggers*/class HasNoCategoryTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\HasNoCategory::triggered*/@@ -61,7 +56,6 @@ class HasNoCategoryTest extends TestCase$journal->categories()->detach();$this->assertEquals(0, $journal->categories()->count());-$trigger = HasNoCategory::makeFromStrings('', false);$result = $trigger->triggered($journal);$this->assertTrue($result);@@ -81,7 +75,6 @@ class HasNoCategoryTest extends TestCase$this->assertEquals(0, $journal->categories()->count());$this->assertEquals(1, $transaction->categories()->count());-$trigger = HasNoCategory::makeFromStrings('', false);$result = $trigger->triggered($journal);$this->assertFalse($result);diff --git a/tests/Unit/TransactionRules/Triggers/HasNoTagTest.php b/tests/Unit/TransactionRules/Triggers/HasNoTagTest.phpindex a50bb18351..3033ae750a 100644--- a/tests/Unit/TransactionRules/Triggers/HasNoTagTest.php+++ b/tests/Unit/TransactionRules/Triggers/HasNoTagTest.php@@ -18,24 +18,19 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\HasNoTag;use Tests\TestCase;/*** Class HasNoTagTest- *- * @package Unit\TransactionRules\Triggers*/class HasNoTagTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\HasNoTag::triggered*/@@ -45,7 +40,6 @@ class HasNoTagTest extends TestCase$journal->tags()->detach();$this->assertEquals(0, $journal->tags()->count());-$trigger = HasNoTag::makeFromStrings('', false);$result = $trigger->triggered($journal);$this->assertTrue($result);diff --git a/tests/Unit/TransactionRules/Triggers/NotesAnyTest.php b/tests/Unit/TransactionRules/Triggers/NotesAnyTest.phpindex eab98856ac..67f9d9e85f 100644--- a/tests/Unit/TransactionRules/Triggers/NotesAnyTest.php+++ b/tests/Unit/TransactionRules/Triggers/NotesAnyTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\NotesAny;@@ -31,12 +29,9 @@ use Tests\TestCase;/*** Class NotesAnyTest- *- * @package Unit\TransactionRules\Triggers*/class NotesAnyTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesAny::triggered*/diff --git a/tests/Unit/TransactionRules/Triggers/NotesAreTest.php b/tests/Unit/TransactionRules/Triggers/NotesAreTest.phpindex 491d1f74d1..0823a29761 100644--- a/tests/Unit/TransactionRules/Triggers/NotesAreTest.php+++ b/tests/Unit/TransactionRules/Triggers/NotesAreTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\NotesAre;@@ -31,12 +29,9 @@ use Tests\TestCase;/*** Class NotesAreTest- *- * @package Unit\TransactionRules\Triggers*/class NotesAreTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered*/@@ -97,7 +92,6 @@ class NotesAreTest extends TestCase$this->assertFalse($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesAre::willMatchEverything*/diff --git a/tests/Unit/TransactionRules/Triggers/NotesContainTest.php b/tests/Unit/TransactionRules/Triggers/NotesContainTest.phpindex 7640d57ac2..2a40f5e6ad 100644--- a/tests/Unit/TransactionRules/Triggers/NotesContainTest.php+++ b/tests/Unit/TransactionRules/Triggers/NotesContainTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\NotesContain;@@ -31,12 +29,9 @@ use Tests\TestCase;/*** Class NotesContainTest- *- * @package Unit\TransactionRules\Triggers*/class NotesContainTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered*/@@ -123,7 +118,6 @@ class NotesContainTest extends TestCase$this->assertTrue($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesContain::willMatchEverything*/diff --git a/tests/Unit/TransactionRules/Triggers/NotesEmptyTest.php b/tests/Unit/TransactionRules/Triggers/NotesEmptyTest.phpindex 545d7c0611..ba07e8ce5f 100644--- a/tests/Unit/TransactionRules/Triggers/NotesEmptyTest.php+++ b/tests/Unit/TransactionRules/Triggers/NotesEmptyTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\NotesEmpty;@@ -31,12 +29,9 @@ use Tests\TestCase;/*** Class NotesEmptyTest- *- * @package Unit\TransactionRules\Triggers*/class NotesEmptyTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesEmpty::triggered*/@@ -90,5 +85,4 @@ class NotesEmptyTest extends TestCase$result = NotesEmpty::willMatchEverything($value);$this->assertFalse($result);}-}diff --git a/tests/Unit/TransactionRules/Triggers/NotesEndTest.php b/tests/Unit/TransactionRules/Triggers/NotesEndTest.phpindex bc68f57e6e..ab39a9dbae 100644--- a/tests/Unit/TransactionRules/Triggers/NotesEndTest.php+++ b/tests/Unit/TransactionRules/Triggers/NotesEndTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\NotesEnd;@@ -31,12 +29,9 @@ use Tests\TestCase;/*** Class NotesEndTest- *- * @package Unit\TransactionRules\Triggers*/class NotesEndTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::triggered*/@@ -95,7 +90,6 @@ class NotesEndTest extends TestCase$this->assertTrue($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::willMatchEverything*/diff --git a/tests/Unit/TransactionRules/Triggers/NotesStartTest.php b/tests/Unit/TransactionRules/Triggers/NotesStartTest.phpindex f062ca007b..7344453078 100644--- a/tests/Unit/TransactionRules/Triggers/NotesStartTest.php+++ b/tests/Unit/TransactionRules/Triggers/NotesStartTest.php@@ -18,12 +18,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\NotesStart;@@ -31,12 +29,9 @@ use Tests\TestCase;/*** Class NotesStartTest- *- * @package Unit\TransactionRules\Triggers*/class NotesStartTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesStart::triggered*/@@ -95,7 +90,6 @@ class NotesStartTest extends TestCase$this->assertTrue($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\NotesStart::willMatchEverything*/diff --git a/tests/Unit/TransactionRules/Triggers/TagIsTest.php b/tests/Unit/TransactionRules/Triggers/TagIsTest.phpindex b51116a06d..6a5c568949 100644--- a/tests/Unit/TransactionRules/Triggers/TagIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/TagIsTest.php@@ -18,24 +18,19 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;-use FireflyIII\Models\TransactionJournal;use FireflyIII\TransactionRules\Triggers\TagIs;use Tests\TestCase;/*** Class TagIsTest- *- * @package Unit\TransactionRules\Triggers*/class TagIsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered*/@@ -61,7 +56,7 @@ class TagIsTest extends TestCase$search = '';foreach ($tags as $index => $tag) {$journal->tags()->save($tag);- if ($index === 1) {+ if (1 === $index) {$search = $tag->tag;}}@@ -82,7 +77,6 @@ class TagIsTest extends TestCase$this->assertFalse($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\TagIs::willMatchEverything*/diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.phpindex e0eac1cfc3..724ae3a301 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class ToAccountContainsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class ToAccountContainsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\ToAccountContains::triggered*/@@ -88,6 +84,4 @@ class ToAccountContainsTest extends TestCase$result = ToAccountContains::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.phpindex 2234ab9f2a..bd13ba99ad 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class ToAccountEndsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class ToAccountEndsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::triggered*/@@ -104,6 +100,4 @@ class ToAccountEndsTest extends TestCase$result = ToAccountEnds::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.phpindex 1f7cc15e27..22bb89e59f 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class ToAccountIsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class ToAccountIsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::triggered*/@@ -49,7 +45,6 @@ class ToAccountIsTest extends TestCase$this->assertTrue($result);}-/*** @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::triggered*/@@ -91,6 +86,4 @@ class ToAccountIsTest extends TestCase$result = ToAccountIs::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.phpindex 13816f3446..40c324f5b8 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,12 +28,9 @@ use Tests\TestCase;/*** Class ToAccountStartsTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class ToAccountStartsTest extends TestCase{-/*** @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::triggered*/@@ -104,6 +100,4 @@ class ToAccountStartsTest extends TestCase$result = ToAccountStarts::willMatchEverything($value);$this->assertTrue($result);}--}diff --git a/tests/Unit/TransactionRules/Triggers/TransactionTypeTest.php b/tests/Unit/TransactionRules/Triggers/TransactionTypeTest.phpindex 8a8d271f3b..04eeeb9490 100644--- a/tests/Unit/TransactionRules/Triggers/TransactionTypeTest.php+++ b/tests/Unit/TransactionRules/Triggers/TransactionTypeTest.php@@ -18,7 +18,6 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-declare(strict_types=1);namespace Tests\Unit\TransactionRules\Triggers;@@ -29,8 +28,6 @@ use Tests\TestCase;/*** Class TransactionTypeTest- *- * @package Tests\Unit\TransactionRules\Triggers*/class TransactionTypeTest extends TestCase{@@ -76,6 +73,4 @@ class TransactionTypeTest extends TestCase$result = TransactionType::willMatchEverything($value);$this->assertTrue($result);}--}