Skip to content

Firefly III: a personal finances manager

Fix test cases.

James Coleae80fd8578a2
diff --git a/tests/integration/Api/Autocomplete/CurrencyControllerTest.php b/tests/integration/Api/Autocomplete/CurrencyControllerTest.php
index 577dd57ac7..6b61462192 100644
--- a/tests/integration/Api/Autocomplete/CurrencyControllerTest.php
+++ b/tests/integration/Api/Autocomplete/CurrencyControllerTest.php
@@ -100,7 +100,7 @@ final class CurrencyControllerTest extends TestCase
$this->actingAs($user);
// create test data
- $this->createTestCurrencies(10, true);
+ $this->createTestCurrencies(9, true);
// test API
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
@@ -134,7 +134,7 @@ final class CurrencyControllerTest extends TestCase
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
$response->assertStatus(200);
$response->assertHeader('Content-Type', 'application/json');
- $response->assertJsonCount(0);
+ $response->assertJsonCount(1); // always connects to EUR.
}
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void
diff --git a/tests/integration/TestCase.php b/tests/integration/TestCase.php
index 6be5deece5..a1feed229d 100644
--- a/tests/integration/TestCase.php
+++ b/tests/integration/TestCase.php
@@ -23,8 +23,10 @@ declare(strict_types=1);
namespace Tests\integration;
+use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\UserGroup;
use FireflyIII\User;
+use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Tests\integration\Traits\CollectsValues;
@@ -35,8 +37,10 @@ abstract class TestCase extends BaseTestCase
{
use CollectsValues;
use CreatesApplication;
+ use RefreshDatabase;
protected const MAX_ITERATIONS = 2;
+ protected $seed = true;
public function dateRangeProvider(): array
{