mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Some last-minute fixes.
This commit is contained in:
@@ -225,7 +225,7 @@ class IndexControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('import.job.download', [$job->key]));
|
||||
$response->assertStatus(200);
|
||||
$response->assertExactJson(['column-mapping-config' => [], 'delimiter' => ',', 'hi' => 'there', 1 => true]);
|
||||
$response->assertExactJson(['column-mapping-config' => ['a', 'b', 'c'], 'delimiter' => ',', 'hi' => 'there', 1 => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -342,8 +342,8 @@ class ImportableConverterTest extends TestCase
|
||||
$this->assertEquals($importable->billName, $result[0]['bill_name']);
|
||||
$this->assertEquals($usd->id, $result[0]['transactions'][0]['currency_id']);
|
||||
// since amount is positive, $asset recieves the money
|
||||
$this->assertEquals($other->id, $result[0]['transactions'][0]['source_id']);
|
||||
$this->assertEquals($asset->id, $result[0]['transactions'][0]['destination_id']);
|
||||
$this->assertEquals($asset->id, $result[0]['transactions'][0]['source_id']);
|
||||
$this->assertEquals($other->id, $result[0]['transactions'][0]['destination_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -412,8 +412,8 @@ class ImportableConverterTest extends TestCase
|
||||
$this->assertEquals($importable->billName, $result[0]['bill_name']);
|
||||
$this->assertEquals($usd->id, $result[0]['transactions'][0]['currency_id']);
|
||||
// since amount is negative, $asset sends the money
|
||||
$this->assertEquals($asset->id, $result[0]['transactions'][0]['source_id']);
|
||||
$this->assertEquals($other->id, $result[0]['transactions'][0]['destination_id']);
|
||||
$this->assertEquals($other->id, $result[0]['transactions'][0]['source_id']);
|
||||
$this->assertEquals($asset->id, $result[0]['transactions'][0]['destination_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -37,7 +37,14 @@ class HasAnyBudgetTest extends TestCase
|
||||
*/
|
||||
public function testTriggered(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$loop = 0;
|
||||
do {
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$count = $journal->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 0 && $loop < 30);
|
||||
|
||||
$budget = $journal->user->budgets()->first();
|
||||
$journal->budgets()->detach();
|
||||
$journal->budgets()->save($budget);
|
||||
@@ -46,6 +53,7 @@ class HasAnyBudgetTest extends TestCase
|
||||
$trigger = HasAnyBudget::makeFromStrings('', false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,11 +61,13 @@ class HasAnyBudgetTest extends TestCase
|
||||
*/
|
||||
public function testTriggeredNot(): void
|
||||
{
|
||||
$loop = 0;
|
||||
do {
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$count = $journal->transactions()->count();
|
||||
} while ($count !== 0);
|
||||
$loop++;
|
||||
} while ($count !== 0 && $loop < 30);
|
||||
|
||||
$journal->budgets()->detach();
|
||||
$this->assertEquals(0, $journal->budgets()->count());
|
||||
@@ -78,7 +88,14 @@ class HasAnyBudgetTest extends TestCase
|
||||
*/
|
||||
public function testTriggeredTransactions(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$loop = 0;
|
||||
do {
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$count = $journal->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 0 && $loop < 30);
|
||||
|
||||
$budget = $journal->user->budgets()->first();
|
||||
$journal->budgets()->detach();
|
||||
$this->assertEquals(0, $journal->budgets()->count());
|
||||
|
Reference in New Issue
Block a user