mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Fix tests
This commit is contained in:
@@ -599,7 +599,7 @@ class Navigation
|
||||
*/
|
||||
public function preferredRangeFormat(Carbon $start, Carbon $end): string
|
||||
{
|
||||
if ((int) $start->diffInMonths($end, true) > 1) {
|
||||
if ((int) $start->diffInMonths($end, true) > 1 && (int) $start->diffInMonths($end, true) <= 12) {
|
||||
return '1M';
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ class Navigation
|
||||
*/
|
||||
public function preferredSqlFormat(Carbon $start, Carbon $end): string
|
||||
{
|
||||
if ((int) $start->diffInMonths($end, true) > 1) {
|
||||
if ((int) $start->diffInMonths($end, true) > 1 && (int) $start->diffInMonths($end, true) <= 12) {
|
||||
return '%Y-%m';
|
||||
}
|
||||
|
||||
|
@@ -44,6 +44,6 @@ final class AccountControllerTest extends TestCase
|
||||
$response = $this->get(route('api.v1.autocomplete.accounts'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(401);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
|
||||
$response->assertContent('{"message":"Unauthenticated.","exception":"AuthenticationException"}');
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ final class BillControllerTest extends TestCase
|
||||
$response = $this->get(route('api.v1.autocomplete.bills'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(401);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
|
||||
$response->assertContent('{"message":"Unauthenticated.","exception":"AuthenticationException"}');
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheBillsEndpointThenReturns200HttpCode(): void
|
||||
|
@@ -78,7 +78,7 @@ final class BudgetControllerTest extends TestCase
|
||||
$response = $this->get(route('api.v1.autocomplete.budgets'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(401);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
|
||||
$response->assertContent('{"message":"Unauthenticated.","exception":"AuthenticationException"}');
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheBudgetsEndpointThenReturns200HttpCode(): void
|
||||
|
@@ -77,7 +77,7 @@ final class CategoryControllerTest extends TestCase
|
||||
$response = $this->get(route('api.v1.autocomplete.categories'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(401);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
|
||||
$response->assertContent('{"message":"Unauthenticated.","exception":"AuthenticationException"}');
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointThenReturns200HttpCode(): void
|
||||
|
@@ -80,7 +80,7 @@ final class CurrencyControllerTest extends TestCase
|
||||
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(401);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
|
||||
$response->assertContent('{"message":"Unauthenticated.","exception":"AuthenticationException"}');
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointThenReturns200HttpCode(): void
|
||||
|
@@ -78,7 +78,7 @@ final class ObjectGroupControllerTest extends TestCase
|
||||
$response = $this->get(route('api.v1.autocomplete.object-groups'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(401);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
|
||||
$response->assertContent('{"message":"Unauthenticated.","exception":"AuthenticationException"}');
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheObjectGroupsEndpointThenReturns200HttpCode(): void
|
||||
|
Reference in New Issue
Block a user