Rename journal collector to more fitting transaction collector.

This commit is contained in:
James Cole
2018-08-11 14:33:47 +02:00
parent 96baf5d3c7
commit 9914c0791e
75 changed files with 595 additions and 1833 deletions

View File

@@ -24,7 +24,7 @@ namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Helpers\Collector\TransactionCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Category;
@@ -87,7 +87,7 @@ class AccountControllerTest extends TestCase
public function testExpenseBudget(string $range): void
{
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$transaction = factory(Transaction::class)->make();
@@ -95,7 +95,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('withBudgetInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]);
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
@@ -114,7 +114,7 @@ class AccountControllerTest extends TestCase
public function testExpenseBudgetAll(string $range): void
{
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$transaction = factory(Transaction::class)->make();
@@ -123,7 +123,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('withBudgetInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]);
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());
@@ -145,14 +145,14 @@ class AccountControllerTest extends TestCase
$transaction = factory(Transaction::class)->make();
$category = factory(Category::class)->make();
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$collector->shouldReceive('setAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$category]));
@@ -173,7 +173,7 @@ class AccountControllerTest extends TestCase
$transaction = factory(Transaction::class)->make();
$category = factory(Category::class)->make();
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
@@ -181,7 +181,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$category]));
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());
@@ -230,14 +230,14 @@ class AccountControllerTest extends TestCase
$transaction = factory(Transaction::class)->make();
$account = factory(Account::class)->make();
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$collector->shouldReceive('setAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::DEPOSIT]])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$account]));
@@ -258,7 +258,7 @@ class AccountControllerTest extends TestCase
$transaction = factory(Transaction::class)->make();
$account = factory(Account::class)->make();
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
@@ -266,7 +266,7 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::DEPOSIT]])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$generator->shouldReceive('pieChart')->andReturn([]);
$categoryRepos->shouldReceive('getCategories')->andReturn(new Collection([$account]));
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());