suin/php-expose
Expose helps PHPUnit tests access private/protected properties and methods in PHP objects. Use a simple fluent API to set non-public attributes and call hidden methods without changing production code. Requires PHP 5.3+ and installs via Composer.
Improved Test Coverage & Maintainability:
Build vs. Buy:
Use Cases:
Roadmap Alignment:
Adopt When:
ReflectionException for non-public members).Look Elsewhere When:
__invoke), which may offer native alternatives."This package lets our QA and dev teams test internal code safely without exposing sensitive logic or breaking encapsulation. It’s like giving PHPUnit a ‘cheat code’ for private methods—critical for maintaining legacy systems, speeding up development, and reducing technical debt. With minimal setup (just a Composer install), we can improve test coverage and catch bugs earlier, saving time and resources in the long run."
Key Ask:
*"Expose solves a common pain point in PHPUnit testing: accessing private/protected members without hacky workarounds. Here’s how we’ll use it:
Trade-offs:
Next Steps:
composer.json and bootstrap PHPUnit.Key Ask:
How can I help you explore Laravel packages today?