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

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace Tests\Feature\Controllers\Json;
use Carbon\Carbon;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Helpers\Collector\TransactionCollectorInterface;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -97,15 +97,15 @@ class BoxControllerTest extends TestCase
public function testBalance(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
// try a collector for income:
/** @var JournalCollectorInterface $collector */
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('setTypes')->andReturnSelf();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection);
$collector->shouldReceive('getTransactions')->andReturn(new Collection);
$this->be($this->user());
$response = $this->get(route('json.box.balance'));
@@ -122,15 +122,14 @@ class BoxControllerTest extends TestCase
$transaction->transaction_amount = '5';
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$collector = $this->mock(TransactionCollectorInterface::class);
// try a collector for income:
/** @var JournalCollectorInterface $collector */
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('setTypes')->andReturnSelf();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getTransactions')->andReturn(new Collection([$transaction]));
$this->be($this->user());
$response = $this->get(route('json.box.balance'));