mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Code for new release
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* BimonthlyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +20,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* DailyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* FortnightlyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* HalfYearlyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* IntervalProvider.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* IntervalTestCase.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,18 +21,17 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use FireflyIII\Support\Calendar\Periodicity\Interval;
|
||||
use Generator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class IntervalTestCase extends TestCase
|
||||
{
|
||||
abstract public static function factory(): Interval;
|
||||
|
||||
abstract public static function provideIntervals(): array;
|
||||
|
||||
public static function provider(): \Generator
|
||||
public static function provider(): Generator
|
||||
{
|
||||
$intervals = static::provideIntervals();
|
||||
/** @var IntervalProvider $interval */
|
||||
@@ -41,9 +40,13 @@ abstract class IntervalTestCase extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
abstract public static function provideIntervals(): array;
|
||||
|
||||
/**
|
||||
* @dataProvider provider
|
||||
*
|
||||
* @param IntervalProvider $provider
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGivenAnEpochWhenCallTheNextDateThenReturnsTheExpectedDateSuccessful(IntervalProvider $provider): void
|
||||
@@ -51,4 +54,6 @@ abstract class IntervalTestCase extends TestCase
|
||||
$period = static::factory()->nextDate($provider->epoch);
|
||||
$this->assertEquals($provider->expected->toDateString(), $period->toDateString());
|
||||
}
|
||||
|
||||
abstract public static function factory(): Interval;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* MonthlyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -35,13 +37,11 @@ use FireflyIII\Support\Calendar\Periodicity\Interval;
|
||||
*/
|
||||
class MonthlyTest extends IntervalTestCase
|
||||
{
|
||||
public static function factory(): Interval
|
||||
{
|
||||
public static function factory(): Interval {
|
||||
return new Periodicity\Monthly();
|
||||
}
|
||||
|
||||
public static function provideIntervals(): array
|
||||
{
|
||||
public static function provideIntervals(): array {
|
||||
return [
|
||||
new IntervalProvider(Carbon::now(), Carbon::now()->addMonth(1)),
|
||||
new IntervalProvider(Carbon::parse('2019-01-01'), Carbon::parse('2019-02-01')),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* QuarterlyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -35,13 +37,11 @@ use FireflyIII\Support\Calendar\Periodicity\Interval;
|
||||
*/
|
||||
class QuarterlyTest extends IntervalTestCase
|
||||
{
|
||||
public static function factory(): Interval
|
||||
{
|
||||
public static function factory(): Interval {
|
||||
return new Periodicity\Quarterly();
|
||||
}
|
||||
|
||||
public static function provideIntervals(): array
|
||||
{
|
||||
public static function provideIntervals(): array {
|
||||
return [
|
||||
new IntervalProvider(Carbon::now(), Carbon::now()->addMonths(3)),
|
||||
new IntervalProvider(Carbon::parse('2019-01-29'), Carbon::parse('2019-04-29')),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* WeeklyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -35,13 +37,11 @@ use FireflyIII\Support\Calendar\Periodicity\Interval;
|
||||
*/
|
||||
class WeeklyTest extends IntervalTestCase
|
||||
{
|
||||
public static function factory(): Interval
|
||||
{
|
||||
public static function factory(): Interval {
|
||||
return new Periodicity\Weekly();
|
||||
}
|
||||
|
||||
public static function provideIntervals(): array
|
||||
{
|
||||
public static function provideIntervals(): array {
|
||||
return [
|
||||
new IntervalProvider(Carbon::now(), Carbon::now()->addWeek()),
|
||||
new IntervalProvider(Carbon::parse('2023-01-31'), Carbon::parse('2023-02-07')),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* YearlyTest.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -35,13 +37,11 @@ use FireflyIII\Support\Calendar\Periodicity\Interval;
|
||||
*/
|
||||
class YearlyTest extends IntervalTestCase
|
||||
{
|
||||
public static function factory(): Interval
|
||||
{
|
||||
public static function factory(): Interval {
|
||||
return new Periodicity\Yearly();
|
||||
}
|
||||
|
||||
public static function provideIntervals(): array
|
||||
{
|
||||
public static function provideIntervals(): array {
|
||||
return [
|
||||
new IntervalProvider(Carbon::now(), Carbon::now()->addYears(1)),
|
||||
new IntervalProvider(Carbon::parse('2019-01-29'), Carbon::parse('2020-01-29')),
|
||||
|
||||
Reference in New Issue
Block a user