stratadox / random
Simple random generator abstraction
v0.1
2021-02-13 22:38 UTC
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: ^8.5
- roave/security-advisories: dev-master
README
Simple random generator abstraction.
Installation
Install with: composer install stratadox/random
Why use this
Code that involves random is tricky to test. Using this package, you can inject an IntegerGenerator. In the production setup, you inject the RandomIntegerGenerator. By injecting a PredefinedIntegerGenerator during testing, you can test the code for one or more predefined outcomes of the IntegerGenerator.