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

@@ -26,6 +26,7 @@ namespace Tests\integration\Support\Models;
use Carbon\Carbon;
use FireflyIII\Support\Models\BillDateCalculator;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\integration\TestCase;
/**
@@ -37,19 +38,21 @@ use Tests\integration\TestCase;
*/
final class BillDateCalculatorTest extends TestCase
{
private readonly BillDateCalculator $calculator;
private BillDateCalculator $calculator;
public function __construct(string $name)
public function setUp(): void
{
parent::__construct($name);
parent::setUp();
$this->calculator = new BillDateCalculator();
}
/**
* Stupid long method names I'm not going to do that.
*
* @dataProvider provideDates
*
*/
#[DataProvider('provideDates')]
public function testGivenSomeDataItWorks(Carbon $earliest, Carbon $latest, Carbon $billStart, string $period, int $skip, ?Carbon $lastPaid, array $expected): void
{
$result = $this->calculator->getPayDates($earliest, $latest, $billStart, $period, $skip, $lastPaid);

View File

@@ -35,10 +35,6 @@ use Tests\integration\TestCase;
*/
final class NavigationCustomEndOfPeriodTest extends TestCase
{
public function __construct(string $name)
{
parent::__construct($name);
}
/**
* @preserveGlobalState disabled