mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix test cases.
This commit is contained in:
parent
c17f2efca6
commit
ae80fd8578
@ -100,7 +100,7 @@ final class CurrencyControllerTest extends TestCase
|
|||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
// create test data
|
// create test data
|
||||||
$this->createTestCurrencies(10, true);
|
$this->createTestCurrencies(9, true);
|
||||||
|
|
||||||
// test API
|
// test API
|
||||||
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
|
$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 = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
|
||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
$response->assertHeader('Content-Type', 'application/json');
|
$response->assertHeader('Content-Type', 'application/json');
|
||||||
$response->assertJsonCount(0);
|
$response->assertJsonCount(1); // always connects to EUR.
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void
|
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void
|
||||||
|
@ -23,8 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\integration;
|
namespace Tests\integration;
|
||||||
|
|
||||||
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
use FireflyIII\Models\UserGroup;
|
use FireflyIII\Models\UserGroup;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||||
use Tests\integration\Traits\CollectsValues;
|
use Tests\integration\Traits\CollectsValues;
|
||||||
|
|
||||||
@ -35,8 +37,10 @@ abstract class TestCase extends BaseTestCase
|
|||||||
{
|
{
|
||||||
use CollectsValues;
|
use CollectsValues;
|
||||||
use CreatesApplication;
|
use CreatesApplication;
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
protected const MAX_ITERATIONS = 2;
|
protected const MAX_ITERATIONS = 2;
|
||||||
|
protected $seed = true;
|
||||||
|
|
||||||
public function dateRangeProvider(): array
|
public function dateRangeProvider(): array
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user