mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
php cs cleanup
This commit is contained in:
@@ -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()],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user