### Install with Composer Source: https://github.com/roundly-consulting/testing-for-laravel/blob/main/README.md Install the package as a dev dependency using Composer. The --with-all-dependencies flag allows Composer to adjust the phpunit/phpunit version to match your Pest major (PHPUnit 12 for Pest 4, PHPUnit 13 for Pest 5). ```bash composer require --dev roundly-consulting/testing-for-laravel --with-all-dependencies ``` -------------------------------- ### Pin package behavior with architecture presets Source: https://github.com/roundly-consulting/testing-for-laravel/blob/main/README.md Use the provided test helpers to pin what the package ships. Every assertion fails over an empty parse instead of passing. The example checks migration order, config contract, and applies architecture presets for strict types, final by default, and no debugging leftovers. ```php use RoundlyConsulting\Testing\Arch\ArchPresets; it('has a runnable migration order', function (): void { expect(__DIR__.'/../../database/migrations') ->toHaveRunnableMigrationOrder(foreignKeys: 3, externalTables: ['users']); }); it('ships exactly the config keys it reads', function (): void { expect(__DIR__.'/../../config/wallet.php')->toSatisfyConfigContract(__DIR__.'/../../src'); }); ArchPresets::strictTypes('RoundlyConsulting\Wallet'); ArchPresets::finalByDefault('RoundlyConsulting\Wallet'); ArchPresets::noDebuggingLeftovers(); ``` -------------------------------- ### Extend PackageTestCase in tests/TestCase.php Source: https://github.com/roundly-consulting/testing-for-laravel/blob/main/README.md Point your package's tests/TestCase.php at the base case, which provides in-memory SQLite with foreign keys on and migrations loaded by provider class. Override packageProviders() and migrationSources() to return the service provider class. ```php use RoundlyConsulting\Testing\PackageTestCase; use RoundlyConsulting\Wallet\WalletServiceProvider; abstract class TestCase extends PackageTestCase { protected function packageProviders(): array { return [WalletServiceProvider::class]; } protected function migrationSources(): array { return [WalletServiceProvider::class]; } } ```