stratadox/random

Simple random generator abstraction

v0.1 2021-02-13 22:38 UTC

This package is auto-updated.

Last update: 2024-11-14 06:44:11 UTC


README

Github Action codecov Scrutinizer Code Quality Latest Stable Version License

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.