Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some code cleanup.
James Cole5ef20678368a
diff --git a/app/Http/Controllers/Chart/TagReportController.php b/app/Http/Controllers/Chart/TagReportController.phpindex 2aca50bc77..5c3ee98ed1 100644--- a/app/Http/Controllers/Chart/TagReportController.php+++ b/app/Http/Controllers/Chart/TagReportController.php@@ -364,4 +364,4 @@ class TagReportController extends Controllerreturn $grouped;}-}\ No newline at end of file+}diff --git a/app/Support/Import/Configuration/Csv/Map.php b/app/Support/Import/Configuration/Csv/Map.phpindex eb51c04e4d..813cecd071 100644--- a/app/Support/Import/Configuration/Csv/Map.php+++ b/app/Support/Import/Configuration/Csv/Map.php@@ -265,4 +265,4 @@ class Map implements ConfigurationInterfacereturn $column;}-}\ No newline at end of file+}diff --git a/public/browserconfig.xml b/public/browserconfig.xmlindex 74bb89ac30..b3930d0f04 100644--- a/public/browserconfig.xml+++ b/public/browserconfig.xml@@ -1,9 +1,9 @@<?xml version="1.0" encoding="utf-8"?><browserconfig>- <msapplication>- <tile>- <square150x150logo src="/mstile-150x150.png"/>- <TileColor>#da532c</TileColor>- </tile>- </msapplication>+ <msapplication>+ <tile>+ <square150x150logo src="/mstile-150x150.png"/>+ <TileColor>#da532c</TileColor>+ </tile>+ </msapplication></browserconfig>diff --git a/public/css/bootstrap-sortable.css b/public/css/bootstrap-sortable.cssindex aed89cd62e..fe3fe8ab05 100755--- a/public/css/bootstrap-sortable.css+++ b/public/css/bootstrap-sortable.css@@ -43,20 +43,20 @@ table.sortable span.arrow, span.reversed, th.arrow.down:after, th.reversedarrow.margin-top: -2px;}- table.sortable span.arrow.up, th.arrow.up:after {- border-color: transparent transparent #ccc transparent;- margin-top: -7px;- }+table.sortable span.arrow.up, th.arrow.up:after {+ border-color: transparent transparent #ccc transparent;+ margin-top: -7px;+}table.sortable span.reversed, th.reversedarrow.down:after {border-color: transparent transparent #ccc transparent;margin-top: -7px;}- table.sortable span.reversed.up, th.reversedarrow.up:after {- border-color: #ccc transparent transparent transparent;- margin-top: -2px;- }+table.sortable span.reversed.up, th.reversedarrow.up:after {+ border-color: #ccc transparent transparent transparent;+ margin-top: -2px;+}table.sortable span.az:before, th.az.down:after {content: "a .. z";@@ -94,17 +94,17 @@ table.sortable span.month.up:before, th.month.up:after {content: "dec .. jan";}-table.sortable>thead th:not([data-defaultsort=disabled]) {+table.sortable > thead th:not([data-defaultsort=disabled]) {cursor: pointer;position: relative;top: 0;left: 0;}-table.sortable>thead th:hover:not([data-defaultsort=disabled]) {+table.sortable > thead th:hover:not([data-defaultsort=disabled]) {background: #efefef;}-table.sortable>thead th div.mozilla {+table.sortable > thead th div.mozilla {position: relative;}diff --git a/public/css/bootstrap-tagsinput.css b/public/css/bootstrap-tagsinput.cssindex 7fced3009d..e8f37d2d64 100755--- a/public/css/bootstrap-tagsinput.css+++ b/public/css/bootstrap-tagsinput.css@@ -4,57 +4,67 @@*/.bootstrap-tagsinput {- background-color: #fff;- border: 1px solid #ccc;- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);- display: inline-block;- padding: 4px 6px;- color: #555;- vertical-align: middle;- border-radius: 4px;- max-width: 100%;- line-height: 22px;- cursor: text;+ background-color: #fff;+ border: 1px solid #ccc;+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);+ display: inline-block;+ padding: 4px 6px;+ color: #555;+ vertical-align: middle;+ border-radius: 4px;+ max-width: 100%;+ line-height: 22px;+ cursor: text;}+.bootstrap-tagsinput input {- border: none;- box-shadow: none;- outline: none;- background-color: transparent;- padding: 0 6px;- margin: 0;- width: auto;- max-width: inherit;+ border: none;+ box-shadow: none;+ outline: none;+ background-color: transparent;+ padding: 0 6px;+ margin: 0;+ width: auto;+ max-width: inherit;}+.bootstrap-tagsinput.form-control input::-moz-placeholder {- color: #777;- opacity: 1;+ color: #777;+ opacity: 1;}+.bootstrap-tagsinput.form-control input:-ms-input-placeholder {- color: #777;+ color: #777;}+.bootstrap-tagsinput.form-control input::-webkit-input-placeholder {- color: #777;+ color: #777;}+.bootstrap-tagsinput input:focus {- border: none;- box-shadow: none;+ border: none;+ box-shadow: none;}+.bootstrap-tagsinput .tag {- margin-right: 2px;- color: white;+ margin-right: 2px;+ color: white;}+.bootstrap-tagsinput .tag [data-role="remove"] {- margin-left: 8px;- cursor: pointer;+ margin-left: 8px;+ cursor: pointer;}+.bootstrap-tagsinput .tag [data-role="remove"]:after {- content: "x";- padding: 0px 2px;+ content: "x";+ padding: 0px 2px;}+.bootstrap-tagsinput .tag [data-role="remove"]:hover {- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);}+.bootstrap-tagsinput .tag [data-role="remove"]:hover:active {- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);}diff --git a/public/css/daterangepicker.css b/public/css/daterangepicker.cssindex a03ff440aa..23fb4e1c69 100755--- a/public/css/daterangepicker.css+++ b/public/css/daterangepicker.css@@ -1,141 +1,213 @@.daterangepicker {- position: absolute;- color: inherit;- background: #fff;- border-radius: 4px;- width: 278px;- padding: 4px;- margin-top: 1px;- top: 100px;- left: 20px;- /* Calendars */ }- .daterangepicker:before, .daterangepicker:after {+ position: absolute;+ color: inherit;+ background: #fff;+ border-radius: 4px;+ width: 278px;+ padding: 4px;+ margin-top: 1px;+ top: 100px;+ left: 20px;+ /* Calendars */+}++.daterangepicker:before, .daterangepicker:after {position: absolute;display: inline-block;border-bottom-color: rgba(0, 0, 0, 0.2);- content: ''; }- .daterangepicker:before {+ content: '';+}++.daterangepicker:before {top: -7px;border-right: 7px solid transparent;border-left: 7px solid transparent;- border-bottom: 7px solid #ccc; }- .daterangepicker:after {+ border-bottom: 7px solid #ccc;+}++.daterangepicker:after {top: -6px;border-right: 6px solid transparent;border-bottom: 6px solid #fff;- border-left: 6px solid transparent; }- .daterangepicker.opensleft:before {- right: 9px; }- .daterangepicker.opensleft:after {- right: 10px; }- .daterangepicker.openscenter:before {+ border-left: 6px solid transparent;+}++.daterangepicker.opensleft:before {+ right: 9px;+}++.daterangepicker.opensleft:after {+ right: 10px;+}++.daterangepicker.openscenter:before {left: 0;right: 0;width: 0;margin-left: auto;- margin-right: auto; }- .daterangepicker.openscenter:after {+ margin-right: auto;+}++.daterangepicker.openscenter:after {left: 0;right: 0;width: 0;margin-left: auto;- margin-right: auto; }- .daterangepicker.opensright:before {- left: 9px; }- .daterangepicker.opensright:after {- left: 10px; }- .daterangepicker.dropup {- margin-top: -5px; }- .daterangepicker.dropup:before {- top: initial;- bottom: -7px;- border-bottom: initial;- border-top: 7px solid #ccc; }- .daterangepicker.dropup:after {- top: initial;- bottom: -6px;- border-bottom: initial;- border-top: 6px solid #fff; }- .daterangepicker.dropdown-menu {+ margin-right: auto;+}++.daterangepicker.opensright:before {+ left: 9px;+}++.daterangepicker.opensright:after {+ left: 10px;+}++.daterangepicker.dropup {+ margin-top: -5px;+}++.daterangepicker.dropup:before {+ top: initial;+ bottom: -7px;+ border-bottom: initial;+ border-top: 7px solid #ccc;+}++.daterangepicker.dropup:after {+ top: initial;+ bottom: -6px;+ border-bottom: initial;+ border-top: 6px solid #fff;+}++.daterangepicker.dropdown-menu {max-width: none;- z-index: 3001; }- .daterangepicker.single .ranges, .daterangepicker.single .calendar {- float: none; }- .daterangepicker.show-calendar .calendar {- display: block; }- .daterangepicker .calendar {+ z-index: 3001;+}++.daterangepicker.single .ranges, .daterangepicker.single .calendar {+ float: none;+}++.daterangepicker.show-calendar .calendar {+ display: block;+}++.daterangepicker .calendar {display: none;max-width: 270px;- margin: 4px; }- .daterangepicker .calendar.single .calendar-table {- border: none; }- .daterangepicker .calendar th, .daterangepicker .calendar td {- white-space: nowrap;- text-align: center;- min-width: 32px; }- .daterangepicker .calendar-table {+ margin: 4px;+}++.daterangepicker .calendar.single .calendar-table {+ border: none;+}++.daterangepicker .calendar th, .daterangepicker .calendar td {+ white-space: nowrap;+ text-align: center;+ min-width: 32px;+}++.daterangepicker .calendar-table {border: 1px solid #fff;padding: 4px;border-radius: 4px;- background: #fff; }- .daterangepicker table {+ background: #fff;+}++.daterangepicker table {width: 100%;- margin: 0; }- .daterangepicker td, .daterangepicker th {+ margin: 0;+}++.daterangepicker td, .daterangepicker th {text-align: center;width: 20px;height: 20px;border-radius: 4px;border: 1px solid transparent;white-space: nowrap;- cursor: pointer; }- .daterangepicker td.available:hover, .daterangepicker th.available:hover {- background-color: #eee;- border-color: transparent;- color: inherit; }- .daterangepicker td.week, .daterangepicker th.week {- font-size: 80%;- color: #ccc; }- .daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {+ cursor: pointer;+}++.daterangepicker td.available:hover, .daterangepicker th.available:hover {+ background-color: #eee;+ border-color: transparent;+ color: inherit;+}++.daterangepicker td.week, .daterangepicker th.week {+ font-size: 80%;+ color: #ccc;+}++.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {background-color: #fff;border-color: transparent;- color: #999; }- .daterangepicker td.in-range {+ color: #999;+}++.daterangepicker td.in-range {background-color: #ebf4f8;border-color: transparent;color: #000;- border-radius: 0; }- .daterangepicker td.start-date {- border-radius: 4px 0 0 4px; }- .daterangepicker td.end-date {- border-radius: 0 4px 4px 0; }- .daterangepicker td.start-date.end-date {- border-radius: 4px; }- .daterangepicker td.active, .daterangepicker td.active:hover {+ border-radius: 0;+}++.daterangepicker td.start-date {+ border-radius: 4px 0 0 4px;+}++.daterangepicker td.end-date {+ border-radius: 0 4px 4px 0;+}++.daterangepicker td.start-date.end-date {+ border-radius: 4px;+}++.daterangepicker td.active, .daterangepicker td.active:hover {background-color: #357ebd;border-color: transparent;- color: #fff; }- .daterangepicker th.month {- width: auto; }- .daterangepicker td.disabled, .daterangepicker option.disabled {+ color: #fff;+}++.daterangepicker th.month {+ width: auto;+}++.daterangepicker td.disabled, .daterangepicker option.disabled {color: #999;cursor: not-allowed;- text-decoration: line-through; }- .daterangepicker select.monthselect, .daterangepicker select.yearselect {+ text-decoration: line-through;+}++.daterangepicker select.monthselect, .daterangepicker select.yearselect {font-size: 12px;padding: 1px;height: auto;margin: 0;- cursor: default; }- .daterangepicker select.monthselect {+ cursor: default;+}++.daterangepicker select.monthselect {margin-right: 2%;- width: 56%; }- .daterangepicker select.yearselect {- width: 40%; }- .daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {+ width: 56%;+}++.daterangepicker select.yearselect {+ width: 40%;+}++.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {width: 50px;- margin-bottom: 0; }- .daterangepicker .input-mini {+ margin-bottom: 0;+}++.daterangepicker .input-mini {border: 1px solid #ccc;border-radius: 4px;color: #555;@@ -145,43 +217,62 @@vertical-align: middle;margin: 0 0 5px 0;padding: 0 6px 0 28px;- width: 100%; }- .daterangepicker .input-mini.active {- border: 1px solid #08c;- border-radius: 4px; }- .daterangepicker .daterangepicker_input {- position: relative; }- .daterangepicker .daterangepicker_input i {- position: absolute;- left: 8px;- top: 8px; }- .daterangepicker.rtl .input-mini {+ width: 100%;+}++.daterangepicker .input-mini.active {+ border: 1px solid #08c;+ border-radius: 4px;+}++.daterangepicker .daterangepicker_input {+ position: relative;+}++.daterangepicker .daterangepicker_input i {+ position: absolute;+ left: 8px;+ top: 8px;+}++.daterangepicker.rtl .input-mini {padding-right: 28px;- padding-left: 6px; }- .daterangepicker.rtl .daterangepicker_input i {+ padding-left: 6px;+}++.daterangepicker.rtl .daterangepicker_input i {left: auto;- right: 8px; }- .daterangepicker .calendar-time {+ right: 8px;+}++.daterangepicker .calendar-time {text-align: center;margin: 5px auto;line-height: 30px;position: relative;- padding-left: 28px; }- .daterangepicker .calendar-time select.disabled {- color: #ccc;- cursor: not-allowed; }+ padding-left: 28px;+}++.daterangepicker .calendar-time select.disabled {+ color: #ccc;+ cursor: not-allowed;+}.ranges {- font-size: 11px;- float: none;- margin: 4px;- text-align: left; }- .ranges ul {+ font-size: 11px;+ float: none;+ margin: 4px;+ text-align: left;+}++.ranges ul {list-style: none;margin: 0 auto;padding: 0;- width: 100%; }- .ranges li {+ width: 100%;+}++.ranges li {font-size: 13px;background: #f5f5f5;border: 1px solid #f5f5f5;@@ -189,81 +280,139 @@color: #08c;padding: 3px 12px;margin-bottom: 8px;- cursor: pointer; }- .ranges li:hover {- background: #08c;- border: 1px solid #08c;- color: #fff; }- .ranges li.active {- background: #08c;- border: 1px solid #08c;- color: #fff; }+ cursor: pointer;+}++.ranges li:hover {+ background: #08c;+ border: 1px solid #08c;+ color: #fff;+}++.ranges li.active {+ background: #08c;+ border: 1px solid #08c;+ color: #fff;+}/* Larger Screen Styling */@media (min-width: 564px) {- .daterangepicker {- width: auto; }+ .daterangepicker {+ width: auto;+ }+.daterangepicker .ranges ul {- width: 160px; }+ width: 160px;+ }+.daterangepicker.single .ranges ul {- width: 100%; }+ width: 100%;+ }+.daterangepicker.single .calendar.left {- clear: none; }+ clear: none;+ }+.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {- float: left; }+ float: left;+ }+.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {- float: right; }+ float: right;+ }+.daterangepicker.ltr {- direction: ltr;- text-align: left; }- .daterangepicker.ltr .calendar.left {+ direction: ltr;+ text-align: left;+ }++ .daterangepicker.ltr .calendar.left {clear: left;- margin-right: 0; }- .daterangepicker.ltr .calendar.left .calendar-table {- border-right: none;- border-top-right-radius: 0;- border-bottom-right-radius: 0; }- .daterangepicker.ltr .calendar.right {- margin-left: 0; }- .daterangepicker.ltr .calendar.right .calendar-table {- border-left: none;- border-top-left-radius: 0;- border-bottom-left-radius: 0; }- .daterangepicker.ltr .left .daterangepicker_input {- padding-right: 12px; }- .daterangepicker.ltr .calendar.left .calendar-table {- padding-right: 12px; }- .daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {- float: left; }+ margin-right: 0;+ }++ .daterangepicker.ltr .calendar.left .calendar-table {+ border-right: none;+ border-top-right-radius: 0;+ border-bottom-right-radius: 0;+ }++ .daterangepicker.ltr .calendar.right {+ margin-left: 0;+ }++ .daterangepicker.ltr .calendar.right .calendar-table {+ border-left: none;+ border-top-left-radius: 0;+ border-bottom-left-radius: 0;+ }++ .daterangepicker.ltr .left .daterangepicker_input {+ padding-right: 12px;+ }++ .daterangepicker.ltr .calendar.left .calendar-table {+ padding-right: 12px;+ }++ .daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {+ float: left;+ }+.daterangepicker.rtl {- direction: rtl;- text-align: right; }- .daterangepicker.rtl .calendar.left {+ direction: rtl;+ text-align: right;+ }++ .daterangepicker.rtl .calendar.left {clear: right;- margin-left: 0; }- .daterangepicker.rtl .calendar.left .calendar-table {- border-left: none;- border-top-left-radius: 0;- border-bottom-left-radius: 0; }- .daterangepicker.rtl .calendar.right {- margin-right: 0; }- .daterangepicker.rtl .calendar.right .calendar-table {- border-right: none;- border-top-right-radius: 0;- border-bottom-right-radius: 0; }- .daterangepicker.rtl .left .daterangepicker_input {- padding-left: 12px; }- .daterangepicker.rtl .calendar.left .calendar-table {- padding-left: 12px; }- .daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {+ margin-left: 0;+ }++ .daterangepicker.rtl .calendar.left .calendar-table {+ border-left: none;+ border-top-left-radius: 0;+ border-bottom-left-radius: 0;+ }++ .daterangepicker.rtl .calendar.right {+ margin-right: 0;+ }++ .daterangepicker.rtl .calendar.right .calendar-table {+ border-right: none;+ border-top-right-radius: 0;+ border-bottom-right-radius: 0;+ }++ .daterangepicker.rtl .left .daterangepicker_input {+ padding-left: 12px;+ }++ .daterangepicker.rtl .calendar.left .calendar-table {+ padding-left: 12px;+ }++ .daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {text-align: right;- float: right; } }+ float: right;+ }+}+@media (min-width: 730px) {- .daterangepicker .ranges {- width: auto; }- .daterangepicker.ltr .ranges {- float: left; }- .daterangepicker.rtl .ranges {- float: right; }- .daterangepicker .calendar.left {- clear: none !important; } }+ .daterangepicker .ranges {+ width: auto;+ }++ .daterangepicker.ltr .ranges {+ float: left;+ }++ .daterangepicker.rtl .ranges {+ float: right;+ }++ .daterangepicker .calendar.left {+ clear: none !important;+ }+}diff --git a/public/index.php b/public/index.phpindex 7f21d36fb5..dbab349937 100644--- a/public/index.php+++ b/public/index.php@@ -9,7 +9,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);/*|--------------------------------------------------------------------------@@ -23,7 +23,7 @@ declare(strict_types = 1);|*/-require __DIR__.'/../bootstrap/autoload.php';+require __DIR__ . '/../bootstrap/autoload.php';/*|--------------------------------------------------------------------------@@ -37,7 +37,7 @@ require __DIR__.'/../bootstrap/autoload.php';|*/-$app = require_once __DIR__.'/../bootstrap/app.php';+$app = require_once __DIR__ . '/../bootstrap/app.php';/*|--------------------------------------------------------------------------diff --git a/public/js/ff/budgets/index.js b/public/js/ff/budgets/index.jsindex 06e696ebed..79dd675ecd 100644--- a/public/js/ff/budgets/index.js+++ b/public/js/ff/budgets/index.js@@ -69,13 +69,13 @@ function updateBudgetedAmounts(e) {var spentAmount = parseFloat(spentCell.data('spent'));var newAmountLeft = spentAmount + parseFloat(value);var amountLeftString = accounting.formatMoney(newAmountLeft);- if(newAmountLeft < 0) {+ if (newAmountLeft < 0) {leftCell.html('<span class="text-danger">' + amountLeftString + '</span>');}- if(newAmountLeft > 0) {+ if (newAmountLeft > 0) {leftCell.html('<span class="text-success">' + amountLeftString + '</span>');}- if(newAmountLeft === 0.0) {+ if (newAmountLeft === 0.0) {leftCell.html('<span style="color:#999">' + amountLeftString + '</span>');}diff --git a/public/js/ff/budgets/show.js b/public/js/ff/budgets/show.jsindex 01dda2660e..78feb2e782 100644--- a/public/js/ff/budgets/show.js+++ b/public/js/ff/budgets/show.js@@ -25,6 +25,4 @@ $(function () {pieChart(expenseExpenseUri, 'budget-expense-out');--});diff --git a/public/js/ff/transactions/single/common.js b/public/js/ff/transactions/single/common.jsindex ec137213ab..d8ecc8d30c 100644--- a/public/js/ff/transactions/single/common.js+++ b/public/js/ff/transactions/single/common.js@@ -122,7 +122,7 @@ function convertForeignToNative() {function updateNativeAmount(data) {// if native amount is already filled in, even though we do this for the first time:// don't overrule it.- if(countConversions === 0 && $('#ffInput_native_amount').val().length > 0) {+ if (countConversions === 0 && $('#ffInput_native_amount').val().length > 0) {countConversions++;return;}diff --git a/public/js/ff/transactions/single/edit.js b/public/js/ff/transactions/single/edit.jsindex 7d9308e1cb..4bafe1b1c7 100644--- a/public/js/ff/transactions/single/edit.js+++ b/public/js/ff/transactions/single/edit.js@@ -20,8 +20,8 @@ $(document).ready(function () {$('#ffInput_amount').on('change', convertForeignToNative);// respond to transfer changes:- $('#ffInput_source_account_id').on('change',validateCurrencyForTransfer);- $('#ffInput_destination_account_id').on('change',validateCurrencyForTransfer);+ $('#ffInput_source_account_id').on('change', validateCurrencyForTransfer);+ $('#ffInput_destination_account_id').on('change', validateCurrencyForTransfer);// convert source currency to destination currency (slightly different routine for transfers)$('#ffInput_source_amount').on('change', convertSourceToDestination);@@ -64,7 +64,6 @@ function updateInitialPage() {}-/*** Get accountID based on some meta info.*/diff --git a/public/js/ff/transactions/split/edit.js b/public/js/ff/transactions/split/edit.jsindex 735a3c2088..d9e7e22ed9 100644--- a/public/js/ff/transactions/split/edit.js+++ b/public/js/ff/transactions/split/edit.js@@ -139,10 +139,10 @@ function resetDivSplits() {row.attr('data-split', i);// add or remove class with bg thing- if(i % 2 === 0) {+ if (i % 2 === 0) {row.removeClass('bg-gray-light');}- if(i % 2 === 1) {+ if (i % 2 === 1) {row.addClass('bg-gray-light');}diff --git a/public/manifest.json b/public/manifest.jsonindex 0b22ea1677..e99614ce90 100644--- a/public/manifest.json+++ b/public/manifest.json@@ -17,5 +17,4 @@"display": "standalone","start_url": "/","orientation": "portrait"-}diff --git a/public/safari-pinned-tab.svg b/public/safari-pinned-tab.svgindex cfa922579b..b433d7b8ed 100644--- a/public/safari-pinned-tab.svg+++ b/public/safari-pinned-tab.svg@@ -1,15 +1,15 @@<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"- "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"><svg version="1.0" xmlns="http://www.w3.org/2000/svg"- width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"- preserveAspectRatio="xMidYMid meet">-<metadata>-Created by potrace 1.11, written by Peter Selinger 2001-2013-</metadata>-<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"-fill="#000000" stroke="none">-<path d="M89 4009 c-17 -4 -43 -19 -58 -33 l-26 -26 -2 -1383 -3 -1383 28 -33+ width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"+ preserveAspectRatio="xMidYMid meet">+ <metadata>+ Created by potrace 1.11, written by Peter Selinger 2001-2013+ </metadata>+ <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"+ fill="#000000" stroke="none">+ <path d="M89 4009 c-17 -4 -43 -19 -58 -33 l-26 -26 -2 -1383 -3 -1383 28 -33c19 -23 39 -35 67 -39 22 -4 1144 -7 2493 -6 2449 0 2452 0 2480 21 15 11 3331 39 44 10 19 13 325 13 1389 0 1064 -3 1370 -13 1389 -6 13 -24 33 -39 44-28 21 -31 21 -2487 21 -1353 1 -2474 -2 -2492 -5z m683 -218 c8 -1 -18 -100@@ -28,7 +28,7 @@ m-4527 -1947 c161 -65 301 -202 369 -359 21 -48 25 -61 36 -114 3 -14 7 -28-7 c22 -4 67 -18 100 -31z m4539 -239 c0 -213 -3 -275 -12 -276 -18 -1 -499-1 -525 0 -21 1 -22 2 -9 46 8 25 12 45 10 45 -8 0 58 134 86 175 45 66 128147 190 187 73 46 191 93 243 97 16 1 17 -18 17 -274z"/>-<path d="M1448 3348 c-46 -9 -74 -46 -82 -108 -17 -129 -102 -204 -239 -209+ <path d="M1448 3348 c-46 -9 -74 -46 -82 -108 -17 -129 -102 -204 -239 -209-10 -1 -32 -14 -48 -30 l-29 -29 0 -401 c0 -230 4 -410 10 -425 12 -34 46 -54100 -61 106 -13 192 -94 205 -193 8 -64 19 -88 50 -108 25 -16 101 -18 1118-18 601 -1 1109 2 1131 5 54 9 73 33 90 117 24 117 91 181 206 197 54 8 74 18@@ -39,14 +39,14 @@ m2125 -218 c48 -124 120 -204 229 -255 l73 -33 -2 -269 c-1 -147 -2 -275 -2-1004 0 -14 35 c-46 116 -118 195 -220 242 -38 18 -70 35 -73 39 -4 6 -5 456-1 545 1 15 15 26 56 43 30 12 72 36 94 51 49 36 114 120 137 180 10 25 21 4725 50 4 3 456 5 1005 5 l997 0 10 -25z"/>-<path d="M2013 3012 c-34 -5 -73 -58 -73 -99 0 -52 55 -102 104 -94 4 1 16 -1+ <path d="M2013 3012 c-34 -5 -73 -58 -73 -99 0 -52 55 -102 104 -94 4 1 16 -125 -4 16 -5 17 -32 17 -319 0 -242 3 -320 13 -339 35 -66 137 -65 172 0 10 1913 107 14 386 1 199 -3 378 -8 397 -14 57 -45 73 -151 74 -50 1 -101 0 -113-2z"/>-<path d="M2608 3012 c-35 -9 -58 -28 -71 -56 -12 -25 -14 -101 -12 -406 1+ <path d="M2608 3012 c-35 -9 -58 -28 -71 -56 -12 -25 -14 -101 -12 -406 1-206 5 -383 9 -392 4 -9 20 -25 34 -34 24 -16 57 -18 276 -19 282 -1 302 3322 65 15 45 17 731 3 777 -20 63 -37 67 -306 68 -132 0 -247 -1 -255 -3zm370 -453 l2 -256 -128 1 -129 0 -1 250 c0 138 1 253 3 256 2 4 59 6 127 6l123 -1 3 -256z"/>-</g>+ </g></svg>diff --git a/routes/api.php b/routes/api.phpindex f5c5fdb62b..ff61db1483 100755--- a/routes/api.php+++ b/routes/api.php@@ -9,9 +9,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);--use Illuminate\Http\Request;+declare(strict_types=1);/*|--------------------------------------------------------------------------diff --git a/routes/console.php b/routes/console.phpindex f0c08dc0c1..d03b78b097 100755--- a/routes/console.php+++ b/routes/console.php@@ -9,7 +9,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);/*|--------------------------------------------------------------------------diff --git a/routes/web.php b/routes/web.phpindex 2b2c25e5c1..27724470df 100755--- a/routes/web.php+++ b/routes/web.php@@ -394,15 +394,12 @@ Route::group(Route::post('start/{importJob}', ['uses' => 'ImportController@start', 'as' => 'start']);--//Route::get('settings/{importJob}', ['uses' => 'ImportController@settings', 'as' => 'settings']);//Route::get('complete/{importJob}', ['uses' => 'ImportController@complete', 'as' => 'complete']);//Route::get('finished/{importJob}', ['uses' => 'ImportController@finished', 'as' => 'finished']);//Route::post('settings/{importJob}', ['uses' => 'ImportController@postSettings', 'as' => 'post-settings']);-});diff --git a/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php b/tests/Feature/Controllers/Admin/ConfigurationControllerTest.phpindex 44bad78766..a581937ea8 100644--- a/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php+++ b/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Admin;diff --git a/tests/Feature/Controllers/Admin/HomeControllerTest.php b/tests/Feature/Controllers/Admin/HomeControllerTest.phpindex b31d833ff4..3602c0851f 100644--- a/tests/Feature/Controllers/Admin/HomeControllerTest.php+++ b/tests/Feature/Controllers/Admin/HomeControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Admin;diff --git a/tests/Feature/Controllers/Admin/UserControllerTest.php b/tests/Feature/Controllers/Admin/UserControllerTest.phpindex d272442aba..4b656ebe79 100644--- a/tests/Feature/Controllers/Admin/UserControllerTest.php+++ b/tests/Feature/Controllers/Admin/UserControllerTest.php@@ -81,9 +81,9 @@ class UserControllerTest extends TestCase$repository = $this->mock(UserRepositoryInterface::class);$repository->shouldReceive('changePassword')->once();$repository->shouldReceive('changeStatus')->once();- $data = [+ $data = ['id' => 1,- 'email' => '[email protected]',+ 'email' => '[email protected]','password' => 'james','password_confirmation' => 'james','blocked_code' => 'blocked',diff --git a/tests/Feature/Controllers/AttachmentControllerTest.php b/tests/Feature/Controllers/AttachmentControllerTest.phpindex 271767907a..51d2eddcca 100644--- a/tests/Feature/Controllers/AttachmentControllerTest.php+++ b/tests/Feature/Controllers/AttachmentControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.phpindex ef7731b512..5c268d3560 100644--- a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php+++ b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php@@ -101,7 +101,7 @@ class TwoFactorControllerTest extends TestCase*/public function testPostIndex(){- $data = ['code' => '123456'];+ $data = ['code' => '123456'];$google = $this->mock(Google2FA::class);$google->shouldReceive('verifyKey')->andReturn(true)->once();diff --git a/tests/Feature/Controllers/BillControllerTest.php b/tests/Feature/Controllers/BillControllerTest.phpindex 22296e6820..9b5b6ca88b 100644--- a/tests/Feature/Controllers/BillControllerTest.php+++ b/tests/Feature/Controllers/BillControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/BudgetControllerTest.php b/tests/Feature/Controllers/BudgetControllerTest.phpindex a0f4d2796b..0e707af8d4 100644--- a/tests/Feature/Controllers/BudgetControllerTest.php+++ b/tests/Feature/Controllers/BudgetControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -134,7 +134,7 @@ class BudgetControllerTest extends TestCase** @param string $range*/- public function testIndexWithDate(string $range)+ public function testIndex(string $range){// mock stuff$budget = factory(Budget::class)->make();@@ -160,7 +160,7 @@ class BudgetControllerTest extends TestCase$this->be($this->user());$this->changeDateRange($this->user(), $range);- $response = $this->get(route('budgets.index', ['2017-01-01']));+ $response = $this->get(route('budgets.index'));$response->assertStatus(200);// has bread crumb$response->assertSee('<ol class="breadcrumb">');@@ -174,7 +174,7 @@ class BudgetControllerTest extends TestCase** @param string $range*/- public function testIndexWithInvalidDate(string $range)+ public function testIndexWithDate(string $range){// mock stuff$budget = factory(Budget::class)->make();@@ -200,7 +200,7 @@ class BudgetControllerTest extends TestCase$this->be($this->user());$this->changeDateRange($this->user(), $range);- $response = $this->get(route('budgets.index', ['Hello-there']));+ $response = $this->get(route('budgets.index', ['2017-01-01']));$response->assertStatus(200);// has bread crumb$response->assertSee('<ol class="breadcrumb">');@@ -214,7 +214,7 @@ class BudgetControllerTest extends TestCase** @param string $range*/- public function testIndex(string $range)+ public function testIndexWithInvalidDate(string $range){// mock stuff$budget = factory(Budget::class)->make();@@ -240,7 +240,7 @@ class BudgetControllerTest extends TestCase$this->be($this->user());$this->changeDateRange($this->user(), $range);- $response = $this->get(route('budgets.index'));+ $response = $this->get(route('budgets.index', ['Hello-there']));$response->assertStatus(200);// has bread crumb$response->assertSee('<ol class="breadcrumb">');diff --git a/tests/Feature/Controllers/CategoryControllerTest.php b/tests/Feature/Controllers/CategoryControllerTest.phpindex 4a61fbb9a6..9400b15134 100644--- a/tests/Feature/Controllers/CategoryControllerTest.php+++ b/tests/Feature/Controllers/CategoryControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/Chart/AccountControllerTest.php b/tests/Feature/Controllers/Chart/AccountControllerTest.phpindex c5c73f8c6c..5c257156c2 100644--- a/tests/Feature/Controllers/Chart/AccountControllerTest.php+++ b/tests/Feature/Controllers/Chart/AccountControllerTest.php@@ -327,7 +327,7 @@ class AccountControllerTest extends TestCase*/public function testRevenueAccounts(string $range){- $account = factory(Account::class)->make();+ $account = factory(Account::class)->make();$generator = $this->mock(GeneratorInterface::class);$accountRepos = $this->mock(AccountRepositoryInterface::class);diff --git a/tests/Feature/Controllers/Chart/BillControllerTest.php b/tests/Feature/Controllers/Chart/BillControllerTest.phpindex 1938f8cd55..91673f5ab2 100644--- a/tests/Feature/Controllers/Chart/BillControllerTest.php+++ b/tests/Feature/Controllers/Chart/BillControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;@@ -54,8 +54,8 @@ class BillControllerTest extends TestCasepublic function testSingle(){$transaction = factory(Transaction::class)->make();- $generator = $this->mock(GeneratorInterface::class);- $collector = $this->mock(JournalCollectorInterface::class);+ $generator = $this->mock(GeneratorInterface::class);+ $collector = $this->mock(JournalCollectorInterface::class);$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();$collector->shouldReceive('setBills')->andReturnSelf()->once();diff --git a/tests/Feature/Controllers/Chart/BudgetControllerTest.php b/tests/Feature/Controllers/Chart/BudgetControllerTest.phpindex 94b4f033f8..f85026cb11 100644--- a/tests/Feature/Controllers/Chart/BudgetControllerTest.php+++ b/tests/Feature/Controllers/Chart/BudgetControllerTest.php@@ -139,7 +139,7 @@ class BudgetControllerTest extends TestCase$accountRepos = $this->mock(AccountRepositoryInterface::class);$transactions = factory(Transaction::class, 10)->make();- $categories = factory(Category::class, 10)->make();+ $categories = factory(Category::class, 10)->make();$collector->shouldReceive('setAllAssetAccounts')->once()->andReturnSelf();$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->once()->andReturnSelf();diff --git a/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php b/tests/Feature/Controllers/Chart/BudgetReportControllerTest.phpindex 51f68239f9..fb2a8d9c05 100644--- a/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php+++ b/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php@@ -35,8 +35,8 @@ class BudgetReportControllerTest extends TestCase*/public function testAccountExpense(){- $generator = $this->mock(GeneratorInterface::class);- $pieChart = $this->mock(MetaPieChartInterface::class);+ $generator = $this->mock(GeneratorInterface::class);+ $pieChart = $this->mock(MetaPieChartInterface::class);$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();$pieChart->shouldReceive('setBudgets')->once()->andReturnSelf();@@ -56,8 +56,8 @@ class BudgetReportControllerTest extends TestCase*/public function testBudgetExpense(){- $generator = $this->mock(GeneratorInterface::class);- $pieChart = $this->mock(MetaPieChartInterface::class);+ $generator = $this->mock(GeneratorInterface::class);+ $pieChart = $this->mock(MetaPieChartInterface::class);$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();$pieChart->shouldReceive('setBudgets')->once()->andReturnSelf();diff --git a/tests/Feature/Controllers/Chart/CategoryControllerTest.php b/tests/Feature/Controllers/Chart/CategoryControllerTest.phpindex 1c73fd6ae4..fd4b1536cb 100644--- a/tests/Feature/Controllers/Chart/CategoryControllerTest.php+++ b/tests/Feature/Controllers/Chart/CategoryControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;diff --git a/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php b/tests/Feature/Controllers/Chart/PiggyBankControllerTest.phpindex 39b5870d68..2806264b34 100644--- a/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php+++ b/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Chart;diff --git a/tests/Feature/Controllers/CurrencyControllerTest.php b/tests/Feature/Controllers/CurrencyControllerTest.phpindex d57331d406..1fa8d5e866 100644--- a/tests/Feature/Controllers/CurrencyControllerTest.php+++ b/tests/Feature/Controllers/CurrencyControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -27,6 +27,24 @@ use Tests\TestCase;class CurrencyControllerTest extends TestCase{+ /**+ * @covers \FireflyIII\Http\Controllers\CurrencyController::create+ */+ public function testCannotCreate()+ {+ // mock stuff+ $userRepos = $this->mock(UserRepositoryInterface::class);+ $journalRepos = $this->mock(JournalRepositoryInterface::class);++ $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);+ $userRepos->shouldReceive('hasRole')->once()->andReturn(false);++ $this->be($this->user());+ $response = $this->get(route('currencies.create'));+ $response->assertStatus(302);+ $response->assertSessionHas('error');+ }+/*** @covers \FireflyIII\Http\Controllers\CurrencyController::delete*/@@ -70,24 +88,6 @@ class CurrencyControllerTest extends TestCase$response->assertSessionHas('error');}- /**- * @covers \FireflyIII\Http\Controllers\CurrencyController::create- */- public function testCannotCreate()- {- // mock stuff- $userRepos = $this->mock(UserRepositoryInterface::class);- $journalRepos = $this->mock(JournalRepositoryInterface::class);-- $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $userRepos->shouldReceive('hasRole')->once()->andReturn(false);-- $this->be($this->user());- $response = $this->get(route('currencies.create'));- $response->assertStatus(302);- $response->assertSessionHas('error');- }-/*** @covers \FireflyIII\Http\Controllers\CurrencyController::create*/@@ -236,7 +236,7 @@ class CurrencyControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\CurrencyController::store*/- public function testStoreNoRights()+ public function testStore(){// mock stuff$repository = $this->mock(CurrencyRepositoryInterface::class);@@ -263,7 +263,7 @@ class CurrencyControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\CurrencyController::store*/- public function testStore()+ public function testStoreNoRights(){// mock stuff$repository = $this->mock(CurrencyRepositoryInterface::class);diff --git a/tests/Feature/Controllers/ExportControllerTest.php b/tests/Feature/Controllers/ExportControllerTest.phpindex 5f17db9773..42976e92db 100644--- a/tests/Feature/Controllers/ExportControllerTest.php+++ b/tests/Feature/Controllers/ExportControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/HelpControllerTest.php b/tests/Feature/Controllers/HelpControllerTest.phpindex 6ee6e31782..24740f766b 100644--- a/tests/Feature/Controllers/HelpControllerTest.php+++ b/tests/Feature/Controllers/HelpControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/HomeControllerTest.php b/tests/Feature/Controllers/HomeControllerTest.phpindex 57754c6784..a706f301f0 100644--- a/tests/Feature/Controllers/HomeControllerTest.php+++ b/tests/Feature/Controllers/HomeControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/ImportControllerTest.php b/tests/Feature/Controllers/ImportControllerTest.phpindex 1473056f64..9b37820f2b 100644--- a/tests/Feature/Controllers/ImportControllerTest.php+++ b/tests/Feature/Controllers/ImportControllerTest.php@@ -188,8 +188,9 @@ class ImportControllerTest extends TestCase$response = $this->post(route('import.start', ['running']));$response->assertStatus(200);}+/**- * @covers \FireflyIII\Http\Controllers\ImportController::start+ * @covers \FireflyIII\Http\Controllers\ImportController::start* @expectedExceptionMessage Job did not complete succesfully.*/public function testStartFailed()diff --git a/tests/Feature/Controllers/JavascriptControllerTest.php b/tests/Feature/Controllers/JavascriptControllerTest.phpindex 737cd8a301..07c91b72bb 100644--- a/tests/Feature/Controllers/JavascriptControllerTest.php+++ b/tests/Feature/Controllers/JavascriptControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -26,20 +26,6 @@ use Tests\TestCase;*/class JavascriptControllerTest extends TestCase{- /**- * @covers \FireflyIII\Http\Controllers\JavascriptController::currencies- */- public function testCurrencies()- {- $repository = $this->mock(CurrencyRepositoryInterface::class);- $currency = factory(TransactionCurrency::class)->make();- $repository->shouldReceive('get')->andReturn(new Collection([$currency]));-- $this->be($this->user());- $response = $this->get(route('javascript.currencies'));- $response->assertStatus(200);- }-/*** @covers \FireflyIII\Http\Controllers\JavascriptController::accounts*/@@ -58,6 +44,20 @@ class JavascriptControllerTest extends TestCase$response->assertStatus(200);}+ /**+ * @covers \FireflyIII\Http\Controllers\JavascriptController::currencies+ */+ public function testCurrencies()+ {+ $repository = $this->mock(CurrencyRepositoryInterface::class);+ $currency = factory(TransactionCurrency::class)->make();+ $repository->shouldReceive('get')->andReturn(new Collection([$currency]));++ $this->be($this->user());+ $response = $this->get(route('javascript.currencies'));+ $response->assertStatus(200);+ }+/*** @covers \FireflyIII\Http\Controllers\JavascriptController::variables* @covers \FireflyIII\Http\Controllers\JavascriptController::getDateRangePickerdiff --git a/tests/Feature/Controllers/JsonControllerTest.php b/tests/Feature/Controllers/JsonControllerTest.phpindex 22c4152d77..1863827c77 100644--- a/tests/Feature/Controllers/JsonControllerTest.php+++ b/tests/Feature/Controllers/JsonControllerTest.php@@ -94,7 +94,7 @@ class JsonControllerTest extends TestCase$billRepos->shouldReceive('getBillsPaidInRange')->andReturn('-100');$this->be($this->user());- $currency = Amount::getDefaultCurrency();+ $currency = Amount::getDefaultCurrency();$response = $this->get(route('json.box.paid'));$response->assertStatus(200);$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'bills-paid']);@@ -114,7 +114,7 @@ class JsonControllerTest extends TestCase$this->be($this->user());- $currency = Amount::getDefaultCurrency();+ $currency = Amount::getDefaultCurrency();$response = $this->get(route('json.box.unpaid'));$response->assertStatus(200);$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'bills-unpaid']);@@ -141,7 +141,7 @@ class JsonControllerTest extends TestCase$this->be($this->user());- $currency = Amount::getDefaultCurrency();+ $currency = Amount::getDefaultCurrency();$response = $this->get(route('json.box.in'));$response->assertStatus(200);$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'in']);@@ -167,7 +167,7 @@ class JsonControllerTest extends TestCase$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->once();$this->be($this->user());- $currency = Amount::getDefaultCurrency();+ $currency = Amount::getDefaultCurrency();$response = $this->get(route('json.box.out'));$response->assertStatus(200);$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'out']);diff --git a/tests/Feature/Controllers/NewUserControllerTest.php b/tests/Feature/Controllers/NewUserControllerTest.phpindex 20215da0e2..810060b424 100644--- a/tests/Feature/Controllers/NewUserControllerTest.php+++ b/tests/Feature/Controllers/NewUserControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/PiggyBankControllerTest.php b/tests/Feature/Controllers/PiggyBankControllerTest.phpindex bd6003b7f5..3d4ddf2405 100644--- a/tests/Feature/Controllers/PiggyBankControllerTest.php+++ b/tests/Feature/Controllers/PiggyBankControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -159,10 +159,10 @@ class PiggyBankControllerTest extends TestCasepublic function testIndex(){// mock stuff- $repository = $this->mock(PiggyBankRepositoryInterface::class);- $journalRepos = $this->mock(JournalRepositoryInterface::class);- $one = factory(PiggyBank::class)->make();- $two = factory(PiggyBank::class)->make();+ $repository = $this->mock(PiggyBankRepositoryInterface::class);+ $journalRepos = $this->mock(JournalRepositoryInterface::class);+ $one = factory(PiggyBank::class)->make();+ $two = factory(PiggyBank::class)->make();$two->account_id = $one->account_id;$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$repository->shouldReceive('getPiggyBanks')->andReturn(new Collection([$one, $two]));diff --git a/tests/Feature/Controllers/Popup/ReportControllerTest.php b/tests/Feature/Controllers/Popup/ReportControllerTest.phpindex 788349b371..fa25a1baf8 100644--- a/tests/Feature/Controllers/Popup/ReportControllerTest.php+++ b/tests/Feature/Controllers/Popup/ReportControllerTest.php@@ -13,13 +13,10 @@ namespace Tests\Feature\Controllers\Popup;use Carbon\Carbon;-use FireflyIII\Helpers\Collector\JournalCollectorInterface;use FireflyIII\Helpers\Report\PopupReportInterface;use FireflyIII\Models\Account;use FireflyIII\Models\Budget;use FireflyIII\Models\Category;-use FireflyIII\Models\Tag;-use FireflyIII\Models\Transaction;use FireflyIII\Repositories\Account\AccountRepositoryInterface;use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use FireflyIII\Repositories\Category\CategoryRepositoryInterface;@@ -165,8 +162,8 @@ class ReportControllerTest extends TestCase$popupHelper = $this->mock(PopupReportInterface::class);- $budget = factory(Budget::class)->make();- $account = factory(Account::class)->make();+ $budget = factory(Budget::class)->make();+ $account = factory(Account::class)->make();$budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);$accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);diff --git a/tests/Feature/Controllers/ProfileControllerTest.php b/tests/Feature/Controllers/ProfileControllerTest.phpindex b8b692e334..6b90fe4eac 100644--- a/tests/Feature/Controllers/ProfileControllerTest.php+++ b/tests/Feature/Controllers/ProfileControllerTest.php@@ -166,7 +166,7 @@ class ProfileControllerTest extends TestCase// mock stuff$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $data = [+ $data = ['password' => 'james2',];$this->be($this->user());diff --git a/tests/Feature/Controllers/Report/AccountControllerTest.php b/tests/Feature/Controllers/Report/AccountControllerTest.phpindex 1e32a4bf9d..28b3199b2a 100644--- a/tests/Feature/Controllers/Report/AccountControllerTest.php+++ b/tests/Feature/Controllers/Report/AccountControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Report;diff --git a/tests/Feature/Controllers/Report/BalanceControllerTest.php b/tests/Feature/Controllers/Report/BalanceControllerTest.phpindex f1d5a29b52..e1e430035d 100644--- a/tests/Feature/Controllers/Report/BalanceControllerTest.php+++ b/tests/Feature/Controllers/Report/BalanceControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Report;diff --git a/tests/Feature/Controllers/Report/BudgetControllerTest.php b/tests/Feature/Controllers/Report/BudgetControllerTest.phpindex e67f603e98..dadc40d924 100644--- a/tests/Feature/Controllers/Report/BudgetControllerTest.php+++ b/tests/Feature/Controllers/Report/BudgetControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Report;diff --git a/tests/Feature/Controllers/Report/CategoryControllerTest.php b/tests/Feature/Controllers/Report/CategoryControllerTest.phpindex 736c6f9f15..8f65479a3c 100644--- a/tests/Feature/Controllers/Report/CategoryControllerTest.php+++ b/tests/Feature/Controllers/Report/CategoryControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Report;diff --git a/tests/Feature/Controllers/Report/OperationsControllerTest.php b/tests/Feature/Controllers/Report/OperationsControllerTest.phpindex 793c7462ab..7da1a00474 100644--- a/tests/Feature/Controllers/Report/OperationsControllerTest.php+++ b/tests/Feature/Controllers/Report/OperationsControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers\Report;diff --git a/tests/Feature/Controllers/RuleControllerTest.php b/tests/Feature/Controllers/RuleControllerTest.phpindex 9ce386446b..8f5bfbdaff 100644--- a/tests/Feature/Controllers/RuleControllerTest.php+++ b/tests/Feature/Controllers/RuleControllerTest.php@@ -274,22 +274,6 @@ class RuleControllerTest extends TestCase$response->assertSessionHas('success');}- /**- * This actually hits an error and not the actually code but OK.- *- * @covers \FireflyIII\Http\Controllers\RuleController::testTriggers- * @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList- */- public function testTestTriggersError()- {- $journalRepos = $this->mock(JournalRepositoryInterface::class);- $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);-- $this->be($this->user());- $uri = route('rules.test-triggers');- $response = $this->get($uri);- $response->assertStatus(200);- }/**** @covers \FireflyIII\Http\Controllers\RuleController::testTriggers@@ -314,7 +298,24 @@ class RuleControllerTest extends TestCase$matcher->shouldReceive('findMatchingTransactions')->andReturn(new Collection);$this->be($this->user());- $uri = route('rules.test-triggers') . '?' . http_build_query($data);+ $uri = route('rules.test-triggers') . '?' . http_build_query($data);+ $response = $this->get($uri);+ $response->assertStatus(200);+ }++ /**+ * This actually hits an error and not the actually code but OK.+ *+ * @covers \FireflyIII\Http\Controllers\RuleController::testTriggers+ * @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList+ */+ public function testTestTriggersError()+ {+ $journalRepos = $this->mock(JournalRepositoryInterface::class);+ $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);++ $this->be($this->user());+ $uri = route('rules.test-triggers');$response = $this->get($uri);$response->assertStatus(200);}@@ -330,7 +331,7 @@ class RuleControllerTest extends TestCase'rule-trigger-value' => ['Bla bla'],'rule-trigger-stop' => ['1'],];- $set = factory(Transaction::class, 10)->make();+ $set = factory(Transaction::class, 10)->make();// mock stuff$matcher = $this->mock(TransactionMatcher::class);@@ -343,7 +344,7 @@ class RuleControllerTest extends TestCase$matcher->shouldReceive('findMatchingTransactions')->andReturn($set);$this->be($this->user());- $uri = route('rules.test-triggers') . '?' . http_build_query($data);+ $uri = route('rules.test-triggers') . '?' . http_build_query($data);$response = $this->get($uri);$response->assertStatus(200);}diff --git a/tests/Feature/Controllers/RuleGroupControllerTest.php b/tests/Feature/Controllers/RuleGroupControllerTest.phpindex 93146babee..110fbd3652 100644--- a/tests/Feature/Controllers/RuleGroupControllerTest.php+++ b/tests/Feature/Controllers/RuleGroupControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;@@ -177,7 +177,6 @@ class RuleGroupControllerTest extends TestCase];-$this->be($this->user());$response = $this->post(route('rule-groups.store', [1]), $data);$response->assertStatus(302);diff --git a/tests/Feature/Controllers/SearchControllerTest.php b/tests/Feature/Controllers/SearchControllerTest.phpindex da2426d5cf..ca0f76fcc4 100644--- a/tests/Feature/Controllers/SearchControllerTest.php+++ b/tests/Feature/Controllers/SearchControllerTest.php@@ -7,7 +7,7 @@* See the LICENSE file for details.*/-declare(strict_types = 1);+declare(strict_types=1);namespace Tests\Feature\Controllers;diff --git a/tests/Feature/Controllers/TagControllerTest.php b/tests/Feature/Controllers/TagControllerTest.phpindex 48c09391a2..7e0feca5fb 100644--- a/tests/Feature/Controllers/TagControllerTest.php+++ b/tests/Feature/Controllers/TagControllerTest.php@@ -154,20 +154,17 @@ class TagControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\TagController::show*/- public function testShowDate()+ public function testShowAll(){// mock stuff$repository = $this->mock(TagRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $repository->shouldReceive('spentInPeriod')->andReturn('-1')->once();$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();- $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once();- $repository->shouldReceive('earnedInPeriod')->andReturn('1')->once();- $repository->shouldReceive('sumOfTag')->andReturn('1')->once();$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);+ $repository->shouldReceive('sumOfTag')->andReturn('1')->once();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);$collector->shouldReceive('setPage')->andReturnSelf()->times(3);@@ -180,7 +177,7 @@ class TagControllerTest extends TestCase$this->be($this->user());- $response = $this->get(route('tags.show', [1, '2016-01-01']));+ $response = $this->get(route('tags.show', [1, 'all']));$response->assertStatus(200);$response->assertSee('<ol class="breadcrumb">');}@@ -188,17 +185,20 @@ class TagControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\TagController::show*/- public function testShowAll()+ public function testShowDate(){// mock stuff$repository = $this->mock(TagRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);+ $repository->shouldReceive('spentInPeriod')->andReturn('-1')->once();$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();+ $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once();+ $repository->shouldReceive('earnedInPeriod')->andReturn('1')->once();+ $repository->shouldReceive('sumOfTag')->andReturn('1')->once();$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);- $repository->shouldReceive('sumOfTag')->andReturn('1')->once();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);$collector->shouldReceive('setPage')->andReturnSelf()->times(3);@@ -211,7 +211,7 @@ class TagControllerTest extends TestCase$this->be($this->user());- $response = $this->get(route('tags.show', [1, 'all']));+ $response = $this->get(route('tags.show', [1, '2016-01-01']));$response->assertStatus(200);$response->assertSee('<ol class="breadcrumb">');}diff --git a/tests/Unit/Handlers/Events/UserEventHandlerTest.php b/tests/Unit/Handlers/Events/UserEventHandlerTest.phpindex dc0e36a62c..d22a3bcaec 100644--- a/tests/Unit/Handlers/Events/UserEventHandlerTest.php+++ b/tests/Unit/Handlers/Events/UserEventHandlerTest.php@@ -15,8 +15,8 @@ namespace Tests\Unit\Handlers\Events;use FireflyIII\Events\RegisteredUser;use FireflyIII\Events\RequestedNewPassword;use FireflyIII\Handlers\Events\UserEventHandler;-use FireflyIII\Mail\RequestedNewPassword as RequestedNewPasswordMail;use FireflyIII\Mail\RegisteredUser as RegisteredUserMail;+use FireflyIII\Mail\RequestedNewPassword as RequestedNewPasswordMail;use FireflyIII\Repositories\User\UserRepositoryInterface;use Illuminate\Support\Facades\Mail;use Tests\TestCase;@@ -67,10 +67,11 @@ class UserEventHandlerTest extends TestCase* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendRegistrationMail* @covers \FireflyIII\Events\RegisteredUser*/- public function testSendRegistrationMail() {+ public function testSendRegistrationMail()+ {Mail::fake();- $user = $this->emptyUser();- $event = new RegisteredUser($user, '127.0.0.1');+ $user = $this->emptyUser();+ $event = new RegisteredUser($user, '127.0.0.1');$listener = new UserEventHandler;$listener->sendRegistrationMail($event);diff --git a/tests/Unit/Helpers/MetaPieChartTest.php b/tests/Unit/Helpers/MetaPieChartTest.phpindex 983ff8016d..471f1526c8 100644--- a/tests/Unit/Helpers/MetaPieChartTest.php+++ b/tests/Unit/Helpers/MetaPieChartTest.php@@ -153,7 +153,6 @@ class MetaPieChartTest extends TestCase$this->assertTrue(true);-}private function fakeOthers(): Collection