mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix code and tests.
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Tests\unit\Support\Calendar;
|
||||
use FireflyIII\Exceptions\IntervalException;
|
||||
use FireflyIII\Support\Calendar\Calculator;
|
||||
use FireflyIII\Support\Calendar\Periodicity;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
use Tests\unit\Support\Calendar\Periodicity\BimonthlyTest;
|
||||
use Tests\unit\Support\Calendar\Periodicity\DailyTest;
|
||||
use Tests\unit\Support\Calendar\Periodicity\FortnightlyTest;
|
||||
|
@@ -25,7 +25,7 @@ declare(strict_types=1);
|
||||
namespace Tests\unit\Support\Calendar\Periodicity;
|
||||
|
||||
use FireflyIII\Support\Calendar\Periodicity\Interval;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
abstract class IntervalTestCase extends TestCase
|
||||
{
|
||||
|
@@ -27,7 +27,7 @@ namespace Tests\unit\Support;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Calendar\Periodicity;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
|
@@ -82,8 +82,9 @@ final class NavigationEndOfPeriodTest extends TestCase
|
||||
*/
|
||||
public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = $this->navigation->endOfPeriod($from, $frequency);
|
||||
$period = clone $this->navigation->endOfPeriod($from, $frequency);
|
||||
self::assertSame($expected->toDateString(), $period->toDateString());
|
||||
|
||||
}
|
||||
|
||||
public static function provideUnknownFrequencies(): iterable
|
||||
|
@@ -25,7 +25,7 @@ declare(strict_types=1);
|
||||
namespace Tests\unit\Support;
|
||||
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
|
@@ -26,7 +26,7 @@ namespace Tests\unit\Support;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
|
@@ -26,7 +26,7 @@ namespace Tests\unit\Support;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
|
@@ -26,7 +26,7 @@ namespace Tests\unit\Support;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
|
@@ -26,7 +26,7 @@ namespace Tests\unit\Support;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
|
@@ -27,7 +27,7 @@ namespace Tests\unit\Support;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Navigation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\integration\TestCase;
|
||||
|
||||
/**
|
||||
* @group unit-test
|
||||
@@ -101,6 +101,8 @@ final class NavigationStartOfPeriodTest extends TestCase
|
||||
*/
|
||||
public function testGivenADateAndUnknownFrequencyWhenCalculateTheDateThenReturnsTheSameDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
Log::spy();
|
||||
|
||||
Log::shouldReceive('error')
|
||||
->with(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $frequency))
|
||||
->andReturnNull()
|
||||
|
Reference in New Issue
Block a user