Files
firefly-iii/tests/integration/Api/Chart/BudgetControllerTest.php

51 lines
1.1 KiB
PHP
Raw Normal View History

2025-08-16 14:52:29 +02:00
<?php
declare(strict_types=1);
2025-08-16 14:52:29 +02:00
namespace Tests\integration\Api\Chart;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\integration\TestCase;
/**
* @internal
*
* @coversNothing
*/
final class BudgetControllerTest extends TestCase
2025-08-16 14:52:29 +02:00
{
use RefreshDatabase;
private $user;
#[Override]
protected function setUp(): void
{
parent::setUp();
if (!isset($this->user)) {
$this->user = $this->createAuthenticatedUser();
}
$this->actingAs($this->user);
}
public function testGetOverviewChartFails(): void
{
$this->actingAs($this->user);
$response = $this->getJson(route('api.v1.chart.budget.overview'));
$response->assertStatus(422);
}
2025-08-16 14:52:29 +02:00
public function testGetOverviewChart(): void
{
$this->actingAs($this->user);
$params = [
2025-08-16 14:52:29 +02:00
'start' => '2024-01-01',
'end' => '2024-01-31',
];
$response = $this->getJson(route('api.v1.chart.budget.overview').'?'.http_build_query($params));
2025-08-16 14:52:29 +02:00
$response->assertStatus(200);
}
}