mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Rename journal collector to more fitting transaction collector.
This commit is contained in:
@@ -23,7 +23,7 @@ declare(strict_types=1);
|
||||
namespace Tests\Feature\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Helpers\Collector\TransactionCollectorInterface;
|
||||
use FireflyIII\Helpers\Filter\InternalTransferFilter;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -67,7 +67,7 @@ class TransactionControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$collector = $this->mock(TransactionCollectorInterface::class);
|
||||
$repository->shouldReceive('firstNull')->twice()->andReturn($transfer);
|
||||
|
||||
$collector->shouldReceive('setTypes')->andReturnSelf();
|
||||
@@ -80,8 +80,8 @@ class TransactionControllerTest extends TestCase
|
||||
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
|
||||
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getJournals')->andReturn(new Collection);
|
||||
$collector->shouldReceive('getPaginatedTransactions')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getTransactions')->andReturn(new Collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.index', ['transfer']));
|
||||
@@ -101,7 +101,7 @@ class TransactionControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$collector = $this->mock(TransactionCollectorInterface::class);
|
||||
$repository->shouldReceive('firstNull')->twice()->andReturn($transfer);
|
||||
|
||||
$collector->shouldReceive('setTypes')->andReturnSelf();
|
||||
@@ -114,8 +114,8 @@ class TransactionControllerTest extends TestCase
|
||||
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
|
||||
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getJournals')->andReturn(new Collection);
|
||||
$collector->shouldReceive('getPaginatedTransactions')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getTransactions')->andReturn(new Collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.index.all', ['transfer']));
|
||||
@@ -142,7 +142,7 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
// mock stuff
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$collector = $this->mock(TransactionCollectorInterface::class);
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
@@ -157,8 +157,8 @@ class TransactionControllerTest extends TestCase
|
||||
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
|
||||
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getJournals')->andReturn($collection);
|
||||
$collector->shouldReceive('getPaginatedTransactions')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getTransactions')->andReturn($collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.index', ['transfer', '2016-01-01']));
|
||||
@@ -185,7 +185,7 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
// mock stuff
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$collector = $this->mock(TransactionCollectorInterface::class);
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
@@ -200,8 +200,8 @@ class TransactionControllerTest extends TestCase
|
||||
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
|
||||
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getJournals')->andReturn($collection);
|
||||
$collector->shouldReceive('getPaginatedTransactions')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getTransactions')->andReturn($collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.index', ['transfer', '2016-01-01', '2015-12-31']));
|
||||
@@ -228,7 +228,7 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
// mock stuff
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$collector = $this->mock(TransactionCollectorInterface::class);
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
@@ -243,8 +243,8 @@ class TransactionControllerTest extends TestCase
|
||||
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
|
||||
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getJournals')->andReturn($collection);
|
||||
$collector->shouldReceive('getPaginatedTransactions')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getTransactions')->andReturn($collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.index', ['deposit']));
|
||||
@@ -271,7 +271,7 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
// mock stuff
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$collector = $this->mock(TransactionCollectorInterface::class);
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn($transfer);
|
||||
@@ -286,8 +286,8 @@ class TransactionControllerTest extends TestCase
|
||||
$collector->shouldReceive('withCategoryInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();
|
||||
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getJournals')->andReturn($collection);
|
||||
$collector->shouldReceive('getPaginatedTransactions')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
$collector->shouldReceive('getTransactions')->andReturn($collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.index', ['withdrawal']));
|
||||
|
Reference in New Issue
Block a user