Final fixes.

This commit is contained in:
James Cole
2025-05-27 17:09:35 +02:00
parent 2cb14f6b72
commit e412e23c87
22 changed files with 574 additions and 385 deletions

View File

@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace Tests\unit\Support;
use Override;
use Iterator;
use FireflyIII\Support\Navigation;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\integration\TestCase;
@@ -41,6 +43,7 @@ final class NavigationPreferredCarbonFormatByPeriodTest extends TestCase
{
private Navigation $navigation;
#[Override]
protected function setUp(): void
{
parent::setUp();
@@ -54,15 +57,18 @@ final class NavigationPreferredCarbonFormatByPeriodTest extends TestCase
self::assertSame($expected, $formatPeriod);
}
public static function providePeriods(): iterable
public static function providePeriods(): Iterator
{
return [
'unknown' => ['period' => '1day', 'expected' => 'Y-m-d'],
'week' => ['period' => '1W', 'expected' => '\WW,Y'],
'month' => ['period' => '1M', 'expected' => 'Y-m'],
'quarterly' => ['period' => '3M', 'expected' => '\QQ,Y'],
'half-yearly' => ['period' => '6M', 'expected' => '\QQ,Y'],
'yearly' => ['period' => '1Y', 'expected' => 'Y'],
];
yield 'unknown' => ['1day', 'Y-m-d'];
yield 'week' => ['1W', '\WW,Y'];
yield 'month' => ['1M', 'Y-m'];
yield 'quarterly' => ['3M', '\QQ,Y'];
yield 'half-yearly' => ['6M', '\QQ,Y'];
yield 'yearly' => ['1Y', 'Y'];
}
}