Library that helps to generate random float datums in data set by defined rules. Sum of datums values are equal to defined amount in data set.
- PHP 7.0 or higher
composer require molsm/random-float-data-set-generator
- Create
DataSet
object
$dataSet = new DataSet(5.0)
- Add Datum to DataSet with your defined rules
$dataset->addDatum((new Datum())->shouldBeBetween(0.0, 10.0), 'id-example');
- Call
generate
method
$result = $dataSet->generate();
- Use resulting array
array('id-example' => 5.0)
Test are located under tests/
Run following command
composer test
This project is licensed under the MIT License - see the LICENSE file for details