mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-21 09:00:07 +00:00
Wrote tests for Limit Controller
This commit is contained in:
@@ -14,6 +14,13 @@ class EloquentLimitRepository implements LimitRepositoryInterface
|
||||
{
|
||||
|
||||
|
||||
public function destroy(\Limit $limit)
|
||||
{
|
||||
$limit->delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $limitId
|
||||
*
|
||||
@@ -27,6 +34,21 @@ class EloquentLimitRepository implements LimitRepositoryInterface
|
||||
->where('components.user_id', \Auth::user()->id)->first(['limits.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Budget $budget
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTJByBudgetAndDateRange(\Budget $budget, Carbon $start, Carbon $end)
|
||||
{
|
||||
$result = $budget->transactionjournals()->with('transactions')->after($start)->before($end)->get();
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
*
|
||||
@@ -94,19 +116,4 @@ class EloquentLimitRepository implements LimitRepositoryInterface
|
||||
return $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Budget $budget
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTJByBudgetAndDateRange(\Budget $budget, Carbon $start, Carbon $end)
|
||||
{
|
||||
$result = $budget->transactionjournals()->with('transactions')->after($start)->before($end)->get();
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,4 +34,6 @@ interface LimitRepositoryInterface
|
||||
* @return mixed
|
||||
*/
|
||||
public function find($limitId);
|
||||
|
||||
public function destroy(\Limit $limit);
|
||||
}
|
||||
Reference in New Issue
Block a user