Small test fixes.

This commit is contained in:
James Cole
2018-09-10 20:22:02 +02:00
parent b30445a5f3
commit 9a34bb7e7a
7 changed files with 13 additions and 12 deletions

View File

@@ -118,7 +118,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('withBudgetInformation')->andReturnSelf(); $collector->shouldReceive('withBudgetInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction])); $collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]); $generator->shouldReceive('multiCurrencyPieChart')->andReturn([]);
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection); $budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
$this->be($this->user()); $this->be($this->user());
@@ -147,7 +147,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('withBudgetInformation')->andReturnSelf(); $collector->shouldReceive('withBudgetInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction])); $collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]); $generator->shouldReceive('multiCurrencyPieChart')->andReturn([]);
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection); $budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth()); $accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());
@@ -179,7 +179,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('withCategoryInformation')->andReturnSelf(); $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction])); $collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]); $generator->shouldReceive('multiCurrencyPieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$category])); $categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$category]));
$this->be($this->user()); $this->be($this->user());
@@ -210,7 +210,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('withCategoryInformation')->andReturnSelf(); $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction])); $collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]); $generator->shouldReceive('multiCurrencyPieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$category])); $categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$category]));
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth()); $accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());
@@ -269,7 +269,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('withCategoryInformation')->andReturnSelf(); $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::DEPOSIT]])->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::DEPOSIT]])->andReturnSelf();
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction])); $collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]); $generator->shouldReceive('multiCurrencyPieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$account])); $categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$account]));
$this->be($this->user()); $this->be($this->user());
@@ -299,7 +299,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('withCategoryInformation')->andReturnSelf(); $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::DEPOSIT]])->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::DEPOSIT]])->andReturnSelf();
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction])); $collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]); $generator->shouldReceive('multiCurrencyPieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$account])); $categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$account]));
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth()); $accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());

View File

@@ -1,6 +1,6 @@
<?php <?php
/** /**
* AmountCreditTest.php * AmountNegatedTest.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
* *
* This file is part of Firefly III. * This file is part of Firefly III.

View File

@@ -27,8 +27,8 @@ use FireflyIII\Import\Mapper\Bills;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Tests\TestCase;
use Log; use Log;
use Tests\TestCase;
/** /**
* Class BillsTest * Class BillsTest

View File

@@ -27,8 +27,8 @@ use FireflyIII\Import\Mapper\Budgets;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Tests\TestCase;
use Log; use Log;
use Tests\TestCase;
/** /**
* Class BudgetsTest * Class BudgetsTest

View File

@@ -27,8 +27,8 @@ use FireflyIII\Import\Mapper\Categories;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Tests\TestCase;
use Log; use Log;
use Tests\TestCase;
/** /**
* Class CategoriesTest * Class CategoriesTest

View File

@@ -27,8 +27,9 @@ use FireflyIII\Import\Mapper\Tags;
use FireflyIII\Models\Tag; use FireflyIII\Models\Tag;
use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Tests\TestCase;
use Log; use Log;
use Tests\TestCase;
/** /**
* Class TagsTest * Class TagsTest
*/ */

View File

@@ -27,8 +27,8 @@ use FireflyIII\Import\Mapper\TransactionCurrencies;
use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Tests\TestCase;
use Log; use Log;
use Tests\TestCase;
/** /**
* Class TransactionCurrenciesTest * Class TransactionCurrenciesTest