herrera-io/phpunit-test-case
PHPUnit TestCase class and Extras trait that add helpers for common test chores: create/delete temporary files and directories, call protected/private methods, and get/set protected/private properties. Use as a base class or mix into your own test case.
actingAs(), refreshDatabase()).storage/framework).symfony/process may introduce flaky tests in CI.TestCase or packages like laravel/testcase for standardized testing?storage:link or filesystem configurations?TestCase + custom traits (recommended).Storage::fake().callPrivateMethod(), createTempFile()).ReflectionTestCase for private methods).Storage::fake().ReflectionTestCase or partialMock().| Feature | Laravel TestCase |
This Package | Notes |
|---|---|---|---|
| Temp files/dirs | ❌ (Manual) | ✅ | Replace with Storage::fake() |
| Private method calls | ❌ (Manual) | ✅ | Use ReflectionTestCase |
| PHPUnit 8+ support | ✅ | ❌ | Critical incompatibility |
| Database testing | ✅ (refreshDatabase) |
❌ | Laravel-specific |
| HTTP testing | ✅ (HttpTests) |
❌ | Laravel-specific |
symfony/process may fail on modern systems (e.g., macOS, Docker).TestCase + ReflectionTestCase provides official support.symfony/process may introduce unnecessary overhead for file operations.| Risk | Impact | Mitigation |
|---|---|---|
| PHPUnit 3.7 incompatibility | Tests fail to run | Fork/update or replace entirely |
| Temp file cleanup conflicts | Data corruption | Use Storage::fake() instead |
| Private method changes | Tests break silently | Replace with ReflectionTestCase |
| CI failures (Symfony/Process) | Build breaks | Pin to latest compatible version |
RefreshDatabase, HttpTests).How can I help you explore Laravel packages today?