stratadox / random
Simple random generator abstraction
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/stratadox/random
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.