Auto commit for release 'develop' on 2025-02-24

This commit is contained in:
github-actions
2025-02-24 04:13:39 +01:00
parent b93cfc5de2
commit 56bac9fc97
24 changed files with 272 additions and 270 deletions

View File

@@ -47,6 +47,15 @@ final class NavigationEndOfPeriodTest extends TestCase
$this->navigation = new Navigation();
}
/**
* @dataProvider provideDates
*/
public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
{
$period = clone $this->navigation->endOfPeriod($from, $frequency);
self::assertSame($expected->toDateString(), $period->toDateString());
}
public static function provideDates(): iterable
{
return [
@@ -78,24 +87,6 @@ final class NavigationEndOfPeriodTest extends TestCase
];
}
public static function provideUnknownFrequencies(): iterable
{
return [
'1day' => ['frequency' => '1day', 'from' => Carbon::now(), 'expected' => Carbon::now()],
'unknown' => ['frequency' => 'unknown', 'from' => Carbon::now(), 'expected' => Carbon::now()->startOfDay()],
'empty' => ['frequency' => '', 'from' => Carbon::now(), 'expected' => Carbon::now()->startOfDay()],
];
}
/**
* @dataProvider provideDates
*/
public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
{
$period = clone $this->navigation->endOfPeriod($from, $frequency);
self::assertSame($expected->toDateString(), $period->toDateString());
}
/**
* @dataProvider provideUnknownFrequencies
*/
@@ -109,4 +100,13 @@ final class NavigationEndOfPeriodTest extends TestCase
Log::shouldHaveReceived('error', [$expectedMessage]);
}
public static function provideUnknownFrequencies(): iterable
{
return [
'1day' => ['frequency' => '1day', 'from' => Carbon::now(), 'expected' => Carbon::now()],
'unknown' => ['frequency' => 'unknown', 'from' => Carbon::now(), 'expected' => Carbon::now()->startOfDay()],
'empty' => ['frequency' => '', 'from' => Carbon::now(), 'expected' => Carbon::now()->startOfDay()],
];
}
}