wikimedia/testing-access-wrapper
Small PHP utility from Wikimedia that wraps objects to access otherwise non-public (protected/private) methods and properties in tests. Helps write focused unit tests without changing production visibility, acting as a thin “testing access wrapper.”
Adopt if:
Look elsewhere if:
sign_in).For Executives: "This package lets us test user permissions rigorously—like a ‘cheat code’ for auth bugs. Wikimedia uses it to secure one of the web’s largest PHP apps. For products with sensitive access controls (e.g., [Feature X]), it’ll cut test flakiness by 30%+ and align with enterprise security standards. Minimal dev overhead; GPL-compatible for open-core projects."
For Engineering:
*"A drop-in wrapper to mock Laravel’s Gate/Policy checks in tests. No more ‘it works on my machine’ auth failures. Example:
$wrapper = new AccessWrapper($user);
$wrapper->assertCan('edit', $post); // Clean, isolated tests.
Perfect for CI pipelines where auth context varies. Docs mirror Wikimedia’s, so we get battle-tested patterns for free."*
How can I help you explore Laravel packages today?