mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Building split transactions and fixing tests.
This commit is contained in:
@@ -155,11 +155,9 @@ class JsonControllerTest extends TestCase
|
||||
*/
|
||||
public function testTransactionJournals($range)
|
||||
{
|
||||
$type = factory(FireflyIII\Models\TransactionType::class)->make();
|
||||
$repository = $this->mock('FireflyIII\Repositories\Journal\JournalRepositoryInterface');
|
||||
|
||||
$repository->shouldReceive('getTransactionType')->with('deposit')->once()->andReturn($type);
|
||||
$repository->shouldReceive('getJournalsOfType')->with($type)->once()->andReturn(new Collection);
|
||||
$paginator = new \Illuminate\Pagination\LengthAwarePaginator(new Collection, 0, 40);
|
||||
$repository->shouldReceive('getJournals')->withAnyArgs()->once()->andReturn($paginator);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
|
@@ -68,7 +68,7 @@ class TransactionControllerTest extends TestCase
|
||||
public function testIndex($range)
|
||||
{
|
||||
$journals = $this->mock('FireflyIII\Repositories\Journal\JournalRepositoryInterface');
|
||||
$journals->shouldReceive('getJournalsOfTypes')->once()->andReturn(new LengthAwarePaginator([], 0, 50));
|
||||
$journals->shouldReceive('getJournals')->once()->andReturn(new LengthAwarePaginator([], 0, 50));
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
@@ -117,8 +117,8 @@ class TransactionControllerTest extends TestCase
|
||||
$args = [
|
||||
'what' => 'withdrawal',
|
||||
'description' => 'Something',
|
||||
'account_id' => '1',
|
||||
'expense_account' => 'Some expense',
|
||||
'source_account_id' => '1',
|
||||
'destination_account_name' => 'Some expense',
|
||||
'amount' => 100,
|
||||
'amount_currency_id_amount' => 1,
|
||||
'date' => '2015-01-01',
|
||||
@@ -141,10 +141,10 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
$args = [
|
||||
'what' => 'withdrawal',
|
||||
'id' => 2,
|
||||
'id' => 4,
|
||||
'description' => 'Something new',
|
||||
'account_id' => '1',
|
||||
'expense_account' => 'Some expense',
|
||||
'source_account_id' => '1',
|
||||
'destination_account_name' => 'Some expense account',
|
||||
'amount' => 100,
|
||||
'amount_currency_id_amount' => 1,
|
||||
'date' => '2015-01-01',
|
||||
|
Reference in New Issue
Block a user