mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Fix phpunit tests
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Tests\unit\Support;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Calendar\Periodicity;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
@@ -40,17 +41,18 @@ use Tests\integration\TestCase;
|
||||
*/
|
||||
final class NavigationAddPeriodTest 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 providePeriodsWithSkippingParam
|
||||
*
|
||||
*/
|
||||
#[DataProvider('providePeriodsWithSkippingParam')]
|
||||
public function testGivenAFrequencyAndSkipIntervalWhenCalculateTheDateThenReturnsTheSkippedDateSuccessful(int $skip, string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = $this->navigation->addPeriod($from, $frequency, $skip);
|
||||
@@ -103,8 +105,9 @@ final class NavigationAddPeriodTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providePeriods
|
||||
*
|
||||
*/
|
||||
#[DataProvider('providePeriods')]
|
||||
public function testGivenAFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = $this->navigation->addPeriod($from, $frequency, 0);
|
||||
@@ -138,8 +141,9 @@ final class NavigationAddPeriodTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideFrequencies
|
||||
*
|
||||
*/
|
||||
#[DataProvider('provideFrequencies')]
|
||||
public function testGivenAIntervalWhenCallTheNextDateByIntervalMethodThenReturnsTheExpectedDateSuccessful(Periodicity $periodicity, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = $this->navigation->nextDateByInterval($from, $periodicity);
|
||||
@@ -175,8 +179,9 @@ final class NavigationAddPeriodTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideMonthPeriods
|
||||
*
|
||||
*/
|
||||
#[DataProvider('provideMonthPeriods')]
|
||||
public function testGivenAMonthFrequencyWhenCalculateTheDateThenReturnsTheLastDayOfMonthSuccessful(string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = $this->navigation->addPeriod($from, $frequency, 0);
|
||||
|
||||
Reference in New Issue
Block a user