Fix phpunit tests

This commit is contained in:
James Cole
2025-05-24 06:07:59 +02:00
parent 3716b50616
commit d26d1b4b87
13 changed files with 77 additions and 52 deletions

View File

@@ -26,6 +26,7 @@ namespace Tests\unit\Support;
use Carbon\Carbon;
use FireflyIII\Support\Navigation;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\integration\TestCase;
/**
@@ -39,17 +40,18 @@ use Tests\integration\TestCase;
*/
final class NavigationPreferredEndOfPeriodTest extends TestCase
{
private readonly Navigation $navigation;
private Navigation $navigation;
public function __construct(string $name)
public function setUp(): void
{
parent::__construct($name);
parent::setUp();
$this->navigation = new Navigation();
}
/**
* @dataProvider providePeriods
*
*/
#[DataProvider('providePeriods')]
public function testGivenStartAndEndDatesWhenCallPreferredEndOfPeriodThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void
{
$formatPeriod = $this->navigation->preferredEndOfPeriod($start, $end);