Wrote tests for Limit Controller

This commit is contained in:
James Cole
2014-08-09 10:01:37 +02:00
parent f792c7add7
commit c06e2380a5
6 changed files with 285 additions and 51 deletions

View File

@@ -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;
}
}