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

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace Tests\unit\Support;
use FireflyIII\Support\Navigation;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\integration\TestCase;
/**
@@ -38,17 +39,18 @@ use Tests\integration\TestCase;
*/
final class NavigationPreferredCarbonFormatByPeriodTest 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 testGivenAPeriodWhenCallPreferredCarbonFormatByPeriodThenReturnsExpectedFormat(string $period, string $expected): void
{
$formatPeriod = $this->navigation->preferredCarbonFormatByPeriod($period);