mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 16:40:10 +00:00
Code cleanup and realign.
This commit is contained in:
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
namespace Tests\Feature\Controllers\Transaction;
|
||||
|
||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -77,7 +76,6 @@ class SplitControllerTest extends TestCase
|
||||
$currencyRepository->shouldReceive('findNull')->withArgs([1])->andReturn(TransactionCurrency::find(1));
|
||||
|
||||
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$destination = $deposit->transactions()->where('amount', '>', 0)->first();
|
||||
$account = $destination->account;
|
||||
@@ -131,7 +129,6 @@ class SplitControllerTest extends TestCase
|
||||
$currencyRepository->shouldReceive('findNull')->withArgs([1])->andReturn(TransactionCurrency::find(1));
|
||||
|
||||
|
||||
|
||||
$currencyRepository->shouldReceive('get')->once()->andReturn(new Collection);
|
||||
$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
|
||||
|
||||
@@ -292,15 +289,15 @@ class SplitControllerTest extends TestCase
|
||||
$this->session(['transactions.edit-split.uri' => 'http://localhost']);
|
||||
$deposit = $this->user()->transactionJournals()->where('transaction_type_id', 2)->first();
|
||||
$data = [
|
||||
'id' => $deposit->id,
|
||||
'what' => 'deposit',
|
||||
'journal_description' => 'Updated salary',
|
||||
'journal_currency_id' => 1,
|
||||
'id' => $deposit->id,
|
||||
'what' => 'deposit',
|
||||
'journal_description' => 'Updated salary',
|
||||
'journal_currency_id' => 1,
|
||||
'journal_destination_id' => 1,
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
[
|
||||
'transaction_description' => 'Split #1',
|
||||
'source_name' => 'Job',
|
||||
@@ -342,15 +339,15 @@ class SplitControllerTest extends TestCase
|
||||
$this->session(['transactions.edit-split.uri' => 'http://localhost']);
|
||||
$opening = TransactionJournal::where('transaction_type_id', 4)->where('user_id', $this->user()->id)->first();
|
||||
$data = [
|
||||
'id' => $opening->id,
|
||||
'what' => 'opening balance',
|
||||
'journal_description' => 'Updated salary',
|
||||
'journal_currency_id' => 1,
|
||||
'id' => $opening->id,
|
||||
'what' => 'opening balance',
|
||||
'journal_description' => 'Updated salary',
|
||||
'journal_currency_id' => 1,
|
||||
'journal_destination_id' => 1,
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
[
|
||||
'transaction_description' => 'Split #1',
|
||||
'source_name' => 'Job',
|
||||
@@ -390,18 +387,18 @@ class SplitControllerTest extends TestCase
|
||||
$this->session(['transactions.edit-split.uri' => 'http://localhost']);
|
||||
$transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();
|
||||
$data = [
|
||||
'id' => $transfer->id,
|
||||
'what' => 'transfer',
|
||||
'journal_description' => 'Some updated withdrawal',
|
||||
'journal_currency_id' => 1,
|
||||
'journal_source_id' => 1,
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
'id' => $transfer->id,
|
||||
'what' => 'transfer',
|
||||
'journal_description' => 'Some updated withdrawal',
|
||||
'journal_currency_id' => 1,
|
||||
'journal_source_id' => 1,
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
[
|
||||
'transaction_description' => 'Split #1',
|
||||
'source_id' => '1',
|
||||
'source_id' => '1',
|
||||
'destination_id' => '2',
|
||||
'transaction_currency_id' => 1,
|
||||
'amount' => 1591,
|
||||
@@ -446,15 +443,15 @@ class SplitControllerTest extends TestCase
|
||||
$this->session(['transactions.edit-split.uri' => 'http://localhost']);
|
||||
$withdrawal = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 1)->first();
|
||||
$data = [
|
||||
'id' => $withdrawal->id,
|
||||
'what' => 'withdrawal',
|
||||
'journal_description' => 'Some updated withdrawal',
|
||||
'journal_currency_id' => 1,
|
||||
'journal_source_id' => 1,
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
'id' => $withdrawal->id,
|
||||
'what' => 'withdrawal',
|
||||
'journal_description' => 'Some updated withdrawal',
|
||||
'journal_currency_id' => 1,
|
||||
'journal_source_id' => 1,
|
||||
'journal_amount' => 1591,
|
||||
'date' => '2014-01-24',
|
||||
'tags' => '',
|
||||
'transactions' => [
|
||||
[
|
||||
'transaction_description' => 'Split #1',
|
||||
'source_id' => '1',
|
||||
|
||||
Reference in New Issue
Block a user