drjele/symfony-phpunit
Symfony bridge for running PHPUnit tests with a simple, consistent setup. Provides helpers and configuration to integrate PHPUnit into Symfony projects, smoothing bootstrapping and test execution across environments.
drjele/symfony-phpunit) is a PHPUnit helper library, primarily designed to simplify test writing in Symfony applications. While Laravel and Symfony share PHPUnit as a testing framework, this package is Symfony-specific (e.g., leveraging Symfony’s container, bundles, or components like Symfony\Bundle\FrameworkBundle\Test\WebTestCase).symfony/http-client or symfony/process in tests).Http or Database test setups).Illuminate\Foundation\Testing\TestCase, Http, DatabaseMigrations) are incompatible with Symfony’s test abstractions (e.g., Client, KernelTestCase).Symfony\Bundle\FrameworkBundle\Test\WebTestCase logic to Laravel’s TestCase).symfony/browser-kit, symfony/css-selector).createApplication(), refreshDatabase()). Are these insufficient?laravel/testbench, spatie/laravel-test-factories) that achieve similar goals?Application vs. Symfony’s Kernel are fundamentally different.Http::fake() vs. Symfony’s Client or BrowserKit.DatabaseMigrations vs. Symfony’s Doctrine integration.Client::create() helpers) could be reused with minimal adaptation.TestCase, RefreshDatabase).composer require drjele/symfony-phpunit --dev).FeatureTest to use Symfony\Bundle\FrameworkBundle\Test\WebTestCase (if Symfony components are present).assertResponseStatusCode() to a Laravel trait.drjele/symfony-phpunit and bridges the gap (e.g., via facades or traits).| Phase | Task | Owner | Dependencies |
|---|---|---|---|
| Discovery | Document current test pain points and Laravel tooling gaps. | QA/Dev Lead | Existing test suite |
| PoC | Adapt 1–2 test files to use the Symfony package. | Backend Dev | Composer, PHPUnit |
| Decision | Evaluate effort vs. benefit; decide on porting, wrapper, or abandonment. | TPM + Tech Lead | PoC Results |
| Implementation | (If viable) Refactor tests or build a Laravel-compatible wrapper. | Dev Team | PoC Code |
| Testing | Validate adapted tests work; ensure no regressions. | QA | CI Pipeline |
| Documentation | Update test guidelines if new patterns are introduced. | Tech Writer | Refactored Tests |
drjele/symfony-phpunit may introduce breaking changes if they rely on Symfony-specific internals (e.g., Kernel methods).TestCase method, adapted tests may need updates.BrowserKit is loaded unnecessarily).| Scenario | Impact | Mitigation |
|---|---|---|
| Package updates break compatibility | Tests fail; rollback required. | Pin to a specific version. |
| Symfony-specific assumptions leak | Laravel tests behave unexpectedly. | Isolate adaptations in a wrapper. |
| Low adoption | Team ignores the package. | Enforce via coding standards. |
| Performance degradation | Tests run slower. | Profile and optimize. |
How can I help you explore Laravel packages today?