mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Expand tests.
This commit is contained in:
@@ -98,15 +98,17 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testBalanceAmountDefaultNoBudget()
|
||||
{
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$account = factory(Account::class)->make();
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$account = factory(Account::class)->make();
|
||||
|
||||
$popupHelper->shouldReceive('balanceForNoBudget')->once()->andReturn(new Collection);
|
||||
$budgetRepos->shouldReceive('find')->andReturn(new Budget)->once()->withArgs([0]);
|
||||
$accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$arguments = [
|
||||
'attributes' => [
|
||||
@@ -132,11 +134,12 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testBalanceAmountDefaultRole()
|
||||
{
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$budget = factory(Budget::class)->make();
|
||||
$account = factory(Account::class)->make();
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$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]);
|
||||
@@ -167,9 +170,10 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testBalanceAmountDiffRole()
|
||||
{
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
|
||||
$budget = factory(Budget::class)->make();
|
||||
$account = factory(Account::class)->make();
|
||||
@@ -204,10 +208,11 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testBalanceAmountTagRole()
|
||||
{
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$budget = factory(Budget::class)->make();
|
||||
$account = factory(Account::class)->make();
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$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]);
|
||||
@@ -238,9 +243,11 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testBudgetSpentAmount()
|
||||
{
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$budget = factory(Budget::class)->make();
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$budget = factory(Budget::class)->make();
|
||||
|
||||
$budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);
|
||||
$popupHelper->shouldReceive('byBudget')->andReturn(new Collection);
|
||||
@@ -269,6 +276,9 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testCategoryEntry()
|
||||
{
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$category = factory(Category::class)->make();
|
||||
@@ -300,9 +310,12 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testExpenseEntry()
|
||||
{
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$account = factory(Account::class)->make();
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$account = factory(Account::class)->make();
|
||||
|
||||
$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($account)->once();
|
||||
$popupHelper->shouldReceive('byExpenses')->andReturn(new Collection);
|
||||
@@ -331,9 +344,12 @@ class ReportControllerTest extends TestCase
|
||||
*/
|
||||
public function testIncomeEntry()
|
||||
{
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$account = factory(Account::class)->make();
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$account = factory(Account::class)->make();
|
||||
|
||||
$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($account)->once();
|
||||
$popupHelper->shouldReceive('byIncome')->andReturn(new Collection);
|
||||
|
||||
Reference in New Issue
Block a user