mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Fix some pointers in test code [skip ci]
This commit is contained in:
parent
19feefda2d
commit
9d8625df3b
@ -30,7 +30,6 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Interface NetWorthInterface
|
||||
*
|
||||
* @package FireflyIII\Helpers\Report
|
||||
*/
|
||||
interface NetWorthInterface
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\BudgetIncomeRequest;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Controllers\DateCalculation;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
@ -41,6 +42,9 @@ use Illuminate\Support\Collection;
|
||||
class AmountController extends Controller
|
||||
{
|
||||
use DateCalculation;
|
||||
|
||||
/** @var OperationsRepositoryInterface */
|
||||
private $opsRepository;
|
||||
/** @var BudgetRepositoryInterface The budget repository */
|
||||
private $repository;
|
||||
|
||||
@ -57,7 +61,8 @@ class AmountController extends Controller
|
||||
function ($request, $next) {
|
||||
app('view')->share('title', (string)trans('firefly.budgets'));
|
||||
app('view')->share('mainTitleIcon', 'fa-tasks');
|
||||
$this->repository = app(BudgetRepositoryInterface::class);
|
||||
$this->repository = app(BudgetRepositoryInterface::class);
|
||||
$this->opsRepository = app(OperationsRepositoryInterface::class);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
@ -69,7 +74,7 @@ class AmountController extends Controller
|
||||
* Set the amount for a single budget in a specific period.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Budget $budget
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
@ -109,7 +114,7 @@ class AmountController extends Controller
|
||||
|
||||
// Get the average amount of money the user budgets for this budget. And calculate the same for the current amount.
|
||||
// If the difference is very large, give the user a notification.
|
||||
$average = $this->repository->budgetedPerDay($budget);
|
||||
$average = $this->opsRepository->budgetedPerDay($budget);
|
||||
$current = bcdiv($amount, (string)$periodLength);
|
||||
if (bccomp(bcmul('1.3', $average), $current) === -1) {
|
||||
$largeDiff = true;
|
||||
@ -149,7 +154,7 @@ class AmountController extends Controller
|
||||
public function postUpdateIncome(BudgetIncomeRequest $request): RedirectResponse
|
||||
{
|
||||
/** @var Carbon $start */
|
||||
$start = Carbon::createFromFormat('Y-m-d', $request->string('start'));
|
||||
$start = Carbon::createFromFormat('Y-m-d', $request->string('start'));
|
||||
/** @var Carbon $end */
|
||||
$end = Carbon::createFromFormat('Y-m-d', $request->string('end'));
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
@ -166,8 +171,8 @@ class AmountController extends Controller
|
||||
* Shows the form to update available budget.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
@ -178,6 +183,6 @@ class AmountController extends Controller
|
||||
$available = round($available, $defaultCurrency->decimal_places);
|
||||
$page = (int)$request->get('page');
|
||||
|
||||
return view('budgets.income', compact('available', 'start', 'end', 'page','defaultCurrency'));
|
||||
return view('budgets.income', compact('available', 'start', 'end', 'page', 'defaultCurrency'));
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Interface NoCategoryRepositoryInterface
|
||||
*
|
||||
* @package FireflyIII\Repositories\Category
|
||||
*/
|
||||
interface NoCategoryRepositoryInterface
|
||||
{
|
||||
|
@ -30,7 +30,6 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Interface OperationsRepositoryInterface
|
||||
*
|
||||
* @package FireflyIII\Repositories\Category
|
||||
*/
|
||||
interface OperationsRepositoryInterface
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ class RuleControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\RuleController
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleStoreRequest
|
||||
*/
|
||||
public function testStore(): void
|
||||
{
|
||||
@ -112,7 +112,7 @@ class RuleControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\RuleController
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleStoreRequest
|
||||
*/
|
||||
public function testStoreNoActions(): void
|
||||
{
|
||||
@ -157,7 +157,7 @@ class RuleControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\RuleController
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleStoreRequest
|
||||
*/
|
||||
public function testStoreNoTriggers(): void
|
||||
{
|
||||
@ -347,7 +347,7 @@ class RuleControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\RuleController
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\RuleUpdateRequest
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ class UserControllerTest extends TestCase
|
||||
* Store new user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserStoreRequest
|
||||
*/
|
||||
public function testStoreBasic(): void
|
||||
{
|
||||
@ -86,7 +86,7 @@ class UserControllerTest extends TestCase
|
||||
* Store new user using JSON.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserStoreRequest
|
||||
*/
|
||||
public function testStoreBasicJson(): void
|
||||
{
|
||||
@ -118,7 +118,7 @@ class UserControllerTest extends TestCase
|
||||
* Store user with info already used.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserStoreRequest
|
||||
*/
|
||||
public function testStoreNotUnique(): void
|
||||
{
|
||||
@ -149,7 +149,7 @@ class UserControllerTest extends TestCase
|
||||
* Store user with info already used.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserStoreRequest
|
||||
*/
|
||||
public function testStoreNotUniqueJson(): void
|
||||
{
|
||||
@ -180,7 +180,7 @@ class UserControllerTest extends TestCase
|
||||
* Update user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserStoreRequest
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
{
|
||||
@ -215,7 +215,7 @@ class UserControllerTest extends TestCase
|
||||
* Update user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserStoreRequest
|
||||
*/
|
||||
public function testUpdateJson(): void
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user