deozza/philarmony-api-tester-bundle
Http::fake(), PestPHP, or Laravel Dusk). May require abstraction layers to bridge gaps.Http::test() or Tests\TestCase.DatabaseTransactions trait (which rolls back after tests). Custom middleware may be needed to reconcile.Laravel Database Factories or Laravel Migrations would require adaptation.YAML/XML) vs. Laravel’s routes/web.php. Route caching or custom route loader might be needed.firewalls) vs. Laravel’s auth() helpers. Middleware abstraction could resolve this.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Database Transaction Conflicts | High | Implement a hybrid approach: Use Laravel’s refreshDatabase() for unit tests and Philarmony’s reset for scenario tests. |
| Symfony-Laravel Abstraction Overhead | Medium | Build a wrapper class to translate Symfony components (e.g., Client → Laravel’s Http) or use Symfony’s HttpClient directly. |
| Fixture Incompatibility | Medium | Migrate existing Laravel factories to Doctrine fixtures or use Laravel’s DatabaseMigrations with Philarmony’s reset logic. |
| Testing Framework Lock-in | Low | Ensure tests remain framework-agnostic (e.g., use PHPUnit assertions over Philarmony’s Symfony-specific assertions). |
| Performance Overhead | Low | Profile database resets and fixture loading; optimize with SQLite for unit tests and MySQL for integration tests. |
DatabaseTransactions with Philarmony’s full database reset? (e.g., parallel test suites)auth() or Symfony’s security system? If hybrid, how will we abstract authentication logic?Laravel Compatibility Matrix:
| Component | Philarmony | Laravel Native | Integration Strategy |
|---|---|---|---|
| HTTP Client | Symfony Client |
Http::test() |
Use Symfony’s Client directly or wrap in Laravel facade. |
| Database Reset | Full DB reset | DatabaseTransactions |
Hybrid: Use Philarmony for scenario tests, Laravel for units. |
| Fixtures | Doctrine Fixtures | Laravel Factories | Convert factories to Doctrine fixtures or use both. |
| Authentication | Symfony Security | Laravel auth() |
Abstract into a custom guard or middleware. |
| Routing | Symfony YAML/XML | PHP routes | Cache routes or use Symfony’s Router component. |
| Testing Framework | PHPUnit (Symfony) | PHPUnit (Laravel) | No change; ensure assertions are framework-agnostic. |
Recommended Stack:
Http::fake() + DatabaseTransactions.Phase 1: Proof of Concept (2-4 weeks)
Client → Laravel Http).Phase 2: Core Integration (4-6 weeks)
PhilarmonyAuthAdapter).Phase 3: Optimization (2-3 weeks)
doctrine/doctrine-fxtures-bundle may clash with Laravel’s doctrine/dbal. Use composer’s replace or aliases to resolve.symfony/http-client can coexist with Laravel’s guzzlehttp/guzzle if not used in the same context.*PhilarmonyTest.php) to avoid polluting existing Laravel test suites.Http::fake() for Philarmony-covered cases).Http::test().Client, fixtures).How can I help you explore Laravel packages today?