Generate test data builder based on Buildotter Core.
This "standalone maker" tries to be agnostic of the framework you are using or not.
If you want to know more about Buildotter, check Buildotter Core.
composer require --dev buildotter/php-maker-standaloneTo generate a builder and the functions following Buildotter Core, let yourself be carried by the interactive command:
php vendor/bin/buildotter-maker-standaloneYou'll have some editing to do after the generation.
Note that the generated code may not comply with your project's coding standards. We work on the assumption that you have a tool that fixes the code style automatically.
For instance, we like to use functions like anElephant() instead of ElephantBuilder::random()
or someElephants() instead of RandomMultiple::from(ElephantBuilder::class, $numberOfItems).
So default behavior is to generate these functions.
Disable the data builders' functions generation by using --no-generated-functions option.
Another example is the presence of the global function random() using fakerphp/faker.
Default behavior is to generate this function if it does not already exist.
Disable the "random" function's generation by using the --no-generated-random-function option.
To check all the options check the help:
php vendor/bin/buildotter-maker-standalone --helpContribution mainly happens on the source code repository at https://github.com/buildotter/php-maker-standalone-src.
Issues are tracked there.
This repository contains only the phar distribution.
Still, you may contribute here with the documentation for instance!