Fix tests

This commit is contained in:
James Cole
2025-06-24 13:25:03 +02:00
parent ae126e8322
commit e0c76695ee
7 changed files with 8 additions and 8 deletions

View File

@@ -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';
}

View File

@@ -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"}');
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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