Expressive fixtures generator
Warning: this doc is for alice 3.0. If you want to check the documentation for 2.x, follow this link.
2.x is in maintenance mode: PRs are accepted, but no active development is done on it by the maintainers any longer.
This is installable via Composer as nelmio/alice:
composer require --dev nelmio/aliceHere is a complete example of entity declaration:
Nelmio\Entity\User:
user{1..10}:
username: '<username()>'
fullname: '<firstName()> <lastName()>'
birthDate: '<date_create()>'
email: '<email()>'
favoriteNumber: '50%? <numberBetween(1, 200)>'
Nelmio\Entity\Group:
group1:
name: Admins
owner: '@user1'
members: '<numberBetween(1, 10)>x @user*'
created: '<dateTimeBetween("-200 days", "now")>'
updated: '<dateTimeBetween($created, "now")>'You can then load them easily with:
$loader = new Nelmio\Alice\Loader\NativeLoader();
$objectSet = $loader->loadFile(__DIR__.'/fixtures.yml');Or load an array right away:
…For more information, refer to the documentation.
Check the contribution guide.
The policy is for the major part following the same as Symfony's one with a few changes or highlights:
@private or @internal are excluded from the BCPNelmio\Alice\Loader\NativeLoader is excluded from the BCP: as it is the no DIC solution, registring a new service
may require a new method, in which case your code may break if you have already declared that method. To avoid that,
please beware of the naming of your methods to avoid any conflicts.Check the upgrade guide.
No open issues yet, or sync has not completed.