Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Organize test suites into unit and integration
Antonio Spinelli7f0db0de0436
diff --git a/composer.json b/composer.jsonindex b05a6a12c4..0b8810c515 100644--- a/composer.json+++ b/composer.json@@ -168,6 +168,12 @@"post-install-cmd": ["@php artisan firefly:instructions install","@php artisan firefly-iii:verify-security-alerts"+ ],+ "unit-test": [+ "@php vendor/bin/phpunit -c phpunit.xml --testsuite unit"+ ],+ "integration-test": [+ "@php vendor/bin/phpunit -c phpunit.xml --testsuite integration"]},"config": {diff --git a/phpunit.xml b/phpunit.xmlindex bdcc61af15..575dac224f 100644--- a/phpunit.xml+++ b/phpunit.xml@@ -21,8 +21,11 @@<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="true" processIsolation="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false"><coverage/><testsuites>- <testsuite name="Api">- <directory suffix="Test.php">./tests</directory>+ <testsuite name="unit">+ <directory suffix="Test.php">./tests/unit</directory>+ </testsuite>+ <testsuite name="integration">+ <directory suffix="Test.php">./tests/integration</directory></testsuite></testsuites><php>diff --git a/tests/Api/Autocomplete/AccountControllerTest.php b/tests/integration/Api/Autocomplete/AccountControllerTest.phpsimilarity index 95%rename from tests/Api/Autocomplete/AccountControllerTest.phprename to tests/integration/Api/Autocomplete/AccountControllerTest.phpindex 7ff8e51672..5eb0ec0ca7 100644--- a/tests/Api/Autocomplete/AccountControllerTest.php+++ b/tests/integration/Api/Autocomplete/AccountControllerTest.php@@ -21,11 +21,11 @@declare(strict_types=1);-namespace Tests\Api\Autocomplete;+namespace Tests\integration\Api\Autocomplete;use Laravel\Passport\Passport;use Log;-use Tests\TestCase;+use Tests\integration\TestCase;/*** Class AccountControllerTestdiff --git a/tests/CreatesApplication.php b/tests/integration/CreatesApplication.phpsimilarity index 97%rename from tests/CreatesApplication.phprename to tests/integration/CreatesApplication.phpindex 22211a5905..1900ee8eb1 100644--- a/tests/CreatesApplication.php+++ b/tests/integration/CreatesApplication.php@@ -20,7 +20,7 @@*/declare(strict_types=1);-namespace Tests;+namespace Tests\integration;use Illuminate\Contracts\Console\Kernel;use Illuminate\Foundation\Application;diff --git a/tests/TestCase.php b/tests/integration/TestCase.phpsimilarity index 95%rename from tests/TestCase.phprename to tests/integration/TestCase.phpindex 4e53124582..e0990a65b6 100644--- a/tests/TestCase.php+++ b/tests/integration/TestCase.php@@ -21,10 +21,10 @@*/declare(strict_types=1);-namespace Tests;+namespace Tests\integration;use Illuminate\Foundation\Testing\TestCase as BaseTestCase;-use Tests\Traits\CollectsValues;+use Tests\integration\Traits\CollectsValues;/*** Class TestCasediff --git a/tests/Traits/CollectsValues.php b/tests/integration/Traits/CollectsValues.phpsimilarity index 96%rename from tests/Traits/CollectsValues.phprename to tests/integration/Traits/CollectsValues.phpindex 33c6bfe647..cae0305ff3 100644--- a/tests/Traits/CollectsValues.php+++ b/tests/integration/Traits/CollectsValues.php@@ -21,7 +21,7 @@declare(strict_types=1);-namespace Tests\Traits;+namespace Tests\integration\Traits;use FireflyIII\User;diff --git a/tests/Support/Calendar/CalculatorProvider.php b/tests/unit/Support/Calendar/CalculatorProvider.phpsimilarity index 99%rename from tests/Support/Calendar/CalculatorProvider.phprename to tests/unit/Support/Calendar/CalculatorProvider.phpindex 20e6172e1e..12f23d7363 100644--- a/tests/Support/Calendar/CalculatorProvider.php+++ b/tests/unit/Support/Calendar/CalculatorProvider.php@@ -19,11 +19,11 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar;+namespace Tests\unit\Support\Calendar;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;-use Tests\Support\Calendar\Periodicity\IntervalProvider;+use Tests\unit\Support\Calendar\Periodicity\IntervalProvider;readonly class CalculatorProvider{diff --git a/tests/Support/Calendar/CalculatorTest.php b/tests/unit/Support/Calendar/CalculatorTest.phpsimilarity index 84%rename from tests/Support/Calendar/CalculatorTest.phprename to tests/unit/Support/Calendar/CalculatorTest.phpindex d3a05fe0cf..a5c8162a01 100644--- a/tests/Support/Calendar/CalculatorTest.php+++ b/tests/unit/Support/Calendar/CalculatorTest.php@@ -19,25 +19,28 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar;+namespace Tests\unit\Support\Calendar;-use Carbon\Carbon;-use FireflyIII\Api\V1\Controllers\Insight\Income\PeriodController;use FireflyIII\Support\Calendar\Calculator;use FireflyIII\Support\Calendar\Exceptions\IntervalException;use FireflyIII\Support\Calendar\Periodicity;-use FireflyIII\Support\Navigation;-use Tests\Support\Calendar\Periodicity\BimonthlyTest;-use Tests\Support\Calendar\Periodicity\DailyTest;-use Tests\Support\Calendar\Periodicity\FortnightlyTest;-use Tests\Support\Calendar\Periodicity\HalfYearlyTest;-use Tests\Support\Calendar\Periodicity\IntervalProvider;-use Tests\Support\Calendar\Periodicity\MonthlyTest;-use Tests\Support\Calendar\Periodicity\QuarterlyTest;-use Tests\Support\Calendar\Periodicity\WeeklyTest;-use Tests\Support\Calendar\Periodicity\YearlyTest;-use Tests\TestCase;+use PHPUnit\Framework\TestCase;+use Tests\unit\Support\Calendar\Periodicity\BimonthlyTest;+use Tests\unit\Support\Calendar\Periodicity\DailyTest;+use Tests\unit\Support\Calendar\Periodicity\FortnightlyTest;+use Tests\unit\Support\Calendar\Periodicity\HalfYearlyTest;+use Tests\unit\Support\Calendar\Periodicity\IntervalProvider;+use Tests\unit\Support\Calendar\Periodicity\MonthlyTest;+use Tests\unit\Support\Calendar\Periodicity\QuarterlyTest;+use Tests\unit\Support\Calendar\Periodicity\WeeklyTest;+use Tests\unit\Support\Calendar\Periodicity\YearlyTest;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group calculator+ */class CalculatorTest extends TestCase{private static function convert(Periodicity $periodicity, array $intervals): arraydiff --git a/tests/Support/Calendar/Periodicity/BimonthlyTest.php b/tests/unit/Support/Calendar/Periodicity/BimonthlyTest.phpsimilarity index 93%rename from tests/Support/Calendar/Periodicity/BimonthlyTest.phprename to tests/unit/Support/Calendar/Periodicity/BimonthlyTest.phpindex 90c46c59b5..e44b188e33 100644--- a/tests/Support/Calendar/Periodicity/BimonthlyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/BimonthlyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class BimonthlyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/DailyTest.php b/tests/unit/Support/Calendar/Periodicity/DailyTest.phpsimilarity index 90%rename from tests/Support/Calendar/Periodicity/DailyTest.phprename to tests/unit/Support/Calendar/Periodicity/DailyTest.phpindex b4f25f2e5e..56169a646b 100644--- a/tests/Support/Calendar/Periodicity/DailyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/DailyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class DailyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/FortnightlyTest.php b/tests/unit/Support/Calendar/Periodicity/FortnightlyTest.phpsimilarity index 90%rename from tests/Support/Calendar/Periodicity/FortnightlyTest.phprename to tests/unit/Support/Calendar/Periodicity/FortnightlyTest.phpindex e28b818e92..abc63993ec 100644--- a/tests/Support/Calendar/Periodicity/FortnightlyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/FortnightlyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class FortnightlyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/HalfYearlyTest.php b/tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.phpsimilarity index 93%rename from tests/Support/Calendar/Periodicity/HalfYearlyTest.phprename to tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.phpindex 08da7027c7..fa15fbfc35 100644--- a/tests/Support/Calendar/Periodicity/HalfYearlyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class HalfYearlyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/IntervalProvider.php b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.phpsimilarity index 95%rename from tests/Support/Calendar/Periodicity/IntervalProvider.phprename to tests/unit/Support/Calendar/Periodicity/IntervalProvider.phpindex 4725885d26..2c62f5802f 100644--- a/tests/Support/Calendar/Periodicity/IntervalProvider.php+++ b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php@@ -19,7 +19,7 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;diff --git a/tests/Support/Calendar/Periodicity/IntervalTestCase.php b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.phpsimilarity index 95%rename from tests/Support/Calendar/Periodicity/IntervalTestCase.phprename to tests/unit/Support/Calendar/Periodicity/IntervalTestCase.phpindex d5db1d901e..a0cf5bb124 100644--- a/tests/Support/Calendar/Periodicity/IntervalTestCase.php+++ b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php@@ -19,10 +19,10 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;-use Tests\TestCase;+use PHPUnit\Framework\TestCase;abstract class IntervalTestCase extends TestCase{diff --git a/tests/Support/Calendar/Periodicity/MonthlyTest.php b/tests/unit/Support/Calendar/Periodicity/MonthlyTest.phpsimilarity index 94%rename from tests/Support/Calendar/Periodicity/MonthlyTest.phprename to tests/unit/Support/Calendar/Periodicity/MonthlyTest.phpindex fab8785a4a..a9fe75d15d 100644--- a/tests/Support/Calendar/Periodicity/MonthlyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/MonthlyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class MonthlyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/QuarterlyTest.php b/tests/unit/Support/Calendar/Periodicity/QuarterlyTest.phpsimilarity index 93%rename from tests/Support/Calendar/Periodicity/QuarterlyTest.phprename to tests/unit/Support/Calendar/Periodicity/QuarterlyTest.phpindex 22a527e109..093276bcb1 100644--- a/tests/Support/Calendar/Periodicity/QuarterlyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/QuarterlyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class QuarterlyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/WeeklyTest.php b/tests/unit/Support/Calendar/Periodicity/WeeklyTest.phpsimilarity index 90%rename from tests/Support/Calendar/Periodicity/WeeklyTest.phprename to tests/unit/Support/Calendar/Periodicity/WeeklyTest.phpindex b889e977cd..b2fa868518 100644--- a/tests/Support/Calendar/Periodicity/WeeklyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/WeeklyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class WeeklyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/Calendar/Periodicity/YearlyTest.php b/tests/unit/Support/Calendar/Periodicity/YearlyTest.phpsimilarity index 91%rename from tests/Support/Calendar/Periodicity/YearlyTest.phprename to tests/unit/Support/Calendar/Periodicity/YearlyTest.phpindex b7f143fd62..fb8e70d9d1 100644--- a/tests/Support/Calendar/Periodicity/YearlyTest.php+++ b/tests/unit/Support/Calendar/Periodicity/YearlyTest.php@@ -19,12 +19,18 @@* along with this program. If not, see <https://www.gnu.org/licenses/>.*/-namespace Tests\Support\Calendar\Periodicity;+namespace Tests\unit\Support\Calendar\Periodicity;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Calendar\Periodicity\Interval;+/**+ * @group unit-test+ * @group support+ * @group calendar+ * @group periodicity+ */class YearlyTest extends IntervalTestCase{public static function factory(): Intervaldiff --git a/tests/Support/NavigationTest.php b/tests/unit/Support/NavigationTest.phpsimilarity index 99%rename from tests/Support/NavigationTest.phprename to tests/unit/Support/NavigationTest.phpindex 5ffdd0dd10..6ad2a395dd 100644--- a/tests/Support/NavigationTest.php+++ b/tests/unit/Support/NavigationTest.php@@ -1,12 +1,17 @@<?php-namespace Tests\Support;+namespace Tests\unit\Support;use Carbon\Carbon;use FireflyIII\Support\Calendar\Periodicity;use FireflyIII\Support\Navigation;-use Tests\TestCase;+use PHPUnit\Framework\TestCase;+/**+ * @group unit-test+ * @group support+ * @group navigation+ */class NavigationTest extends TestCase{private Navigation $navigation;