mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 18:54:58 +00:00 
			
		
		
		
	Organize test suites into unit and integration
This is the goals of project organization composing different combinations to run any number of tests together.
This commit is contained in:
		| @@ -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": { | ||||
|   | ||||
| @@ -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> | ||||
|   | ||||
| @@ -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 AccountControllerTest | ||||
| @@ -20,7 +20,7 @@ | ||||
|  */ | ||||
| declare(strict_types=1); | ||||
| 
 | ||||
| namespace Tests; | ||||
| namespace Tests\integration; | ||||
| 
 | ||||
| use Illuminate\Contracts\Console\Kernel; | ||||
| use Illuminate\Foundation\Application; | ||||
| @@ -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 TestCase | ||||
| @@ -21,7 +21,7 @@ | ||||
| 
 | ||||
| declare(strict_types=1); | ||||
| 
 | ||||
| namespace Tests\Traits; | ||||
| namespace Tests\integration\Traits; | ||||
| 
 | ||||
| use FireflyIII\User; | ||||
| 
 | ||||
| @@ -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 | ||||
| { | ||||
| @@ -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): array | ||||
| @@ -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(): Interval | ||||
| @@ -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(): Interval | ||||
| @@ -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(): Interval | ||||
| @@ -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(): Interval | ||||
| @@ -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; | ||||
| 
 | ||||
| @@ -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 | ||||
| { | ||||
| @@ -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(): Interval | ||||
| @@ -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(): Interval | ||||
| @@ -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(): Interval | ||||
| @@ -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(): Interval | ||||
| @@ -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; | ||||
		Reference in New Issue
	
	Block a user