lastdragon-ru/lara-asp-testing
Testing utilities for integrating Lara ASP into Laravel apps. Provides helpers, fakes, and assertions to simplify writing automated tests around ASP policies, decisions, and request/response flows in your application.
Pros:
Http::fake(), actingAs(), and assertJson() with custom matchers (e.g., assertResponseHasError(), assertUnauthorizedForGuest()), improving test readability and maintainability.Cons:
assertJsonStructure() or PestPHP’s assertions, creating technical debt if the package diverges from Laravel’s roadmap.composer require and minimal configuration (e.g., service provider binding if extending PHPUnit).assertResponseHasError()) could conflict with existing test methods or third-party packages.Why Not Laravel Native?
HttpTests or TestResponse classes (e.g., auth-specific assertions, error validation)?Adoption Viability
Compatibility
--parallel) or CI optimizations?Testing Strategy
Http::fake()?assertJson() calls and could benefit from domain-specific helpers.assertResponseOk()) may overlap heavily, reducing ROI.assertJson() to package assertions (e.g., assertResponseHasField()).phpunit --testdox-html).TestCase, HttpTests, and RefreshDatabase.assertJson()).bcmath, intl, or other extensions.assertStatus(200)).composer.json and publish the package.assertUnauthorizedForGuest() for auth tests").| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package abandoned | Tests break with Laravel updates | Fork and maintain; pin to exact versions. |
| Assertion conflicts | Test suite fails silently | Use unique method names; test in isolation. |
| Over-reliance on package | Hard to debug custom logic | Document "escape hatches" (e.g., raw PHPUnit). |
| Performance regressions | Slow CI builds | Benchmark assertions; avoid in loops. |
assertJson() withHow can I help you explore Laravel packages today?