Alice is an expressive fixtures generator. It is used to generate sample data for e.g. unit testing or pre-filling of databases.
Questions tagged [nelmio-alice]
45 questions
25
votes
2 answers
hautelook/AliceBundle is gone - what's going on & what now?
Answer:
The repository was taken offline by the administrator. The maintainer (Theo Fidry) is locked out. The reason for taking the repository offline is currently unknown.
Head over to https://github.com/nelmio/alice/issues/1089 to get more info &…

Jan Klan
- 667
- 6
- 16
17
votes
1 answer
Multiple reference fixture range @user{1..10}
https://github.com/nelmio/alice/blob/master/README.md#multiple-references
group{1..10}:
members: @user{1..10}
this example is giving problem
Entity with Id @user_{1..2} and Class
Eggs\CoreBundle\Entity\User not found
It is putting as it is. If…

Basit
- 16,316
- 31
- 93
- 154
12
votes
0 answers
Reusable groups of properties or traits in Alice fixtures generator
It's possible to describe fixture inheritance in Alice:
// template.yml
Nelmio\Entity\User:
user (template):
username: ''
age: ''
--
include:
- template.yml
Nelmio\Entity\User:
user1…

luqo33
- 8,001
- 16
- 54
- 107
10
votes
3 answers
Can I override auto increment ID with Alice Fixtures?
I am using Symfony2 with Doctrine and I'm using the Alice Fixture bundle to generate my fixtures for testing.
In one case I need to create a fixture where the id is 148 for a specific test. All of our ids are configured to auto_increment, so I am…

kc_rob
- 147
- 1
- 9
5
votes
1 answer
Symfony 4 Fixtures with Nelmio Alice not persisting
I am having trouble with Data Fixtures with Alice in Symfony 4.
When I run bin/console doctrine:fixtures:load I get asked if I want to purge the db and eventually the command terminates without any errors.
The database gets effectively purged but no…

Martin
- 1,066
- 3
- 20
- 36
5
votes
2 answers
Alice Faker library choose random from array
I am trying to generate a dummy data using AliceBundle for Symfony Framework. Everything seems to be working fine except I am looking for a way to randomly assign data from an array to a property called type. Looking at the faker library I can see…

Shairyar
- 3,268
- 7
- 46
- 86
4
votes
1 answer
How can I parse a Symfony parameter into the fixtures.yml file of Alice
I'm stuck with the package nelmio/alice (Expressive fixtures generator). I don't know how to parse a parameter from the general config/parameters.yml (in my case 'photoupload_directory') file into the fixtures.yml.
Now I have something hard coded…

Vincent
- 41
- 2
3
votes
3 answers
How to create custom function/formatter nelmio/alice v.3?
I'm new to symfony 4 and tried to write my own function for yml nelmio/alice, but after I ran bin/console doctrine:fixtures:load , I got this error:
In DeepCopy.php line 177:
The class "ReflectionClass" is not cloneable.
Here is my fixtures.yml…

Soheil
- 1,201
- 2
- 11
- 18
3
votes
3 answers
Generating Doctrine fixture data for Nested Set entity with Alice Fixtures
I'm using hautelook/AliceBundle (which uses nelmio/alice and fzaninotto/Faker) to generate fixtures for an application. I have a Doctrine entity Group which is a nested set entity (using the Tree functionality provided by…

James Crinkley
- 1,398
- 1
- 13
- 33
3
votes
1 answer
Couldn't generate random unique value for "value" in 128 tries
I am defining this fixture:
Clanmovil\PlatformBundle\Entity\Alias:
alias_{1..500}:
name (unique): Alias_
description:
active:
createdAt:
…

ReynierPM
- 17,594
- 53
- 193
- 363
3
votes
1 answer
Using custom faker data providers without standard doctrine fixtures in Nelmio Alice
I am setting up NelmioAlice and Faker in a Symfony2 project through AlixeFixturesBundle. I need a composed fixture like for example:
representative{1..100}:
veeva_rep_id (unique): qlv_005800000067SwzAAE
which is a qlv_ prefix followed by a…

ReynierPM
- 17,594
- 53
- 193
- 363
3
votes
0 answers
Cannot reference Alice fixture in EntityContext following step (KnpLabs/FriendlyContexts) - Behat
I use the really cool knplabs/friendlycontexts bundle to test VictoireDCMS, a Symfony2 open source DCMS.
Actually, this is working pretty well in spite of the kind of my project (not a basic symfony-project architecture but a suite of bundles with a…

lenybernard
- 2,399
- 22
- 22
2
votes
2 answers
Alice fixtures - Persist and reference a first set of entities/objects
Alice has given away the persistence layer in 3.x.
In the attempt of migrating from 2.2 to 3.0.x, …
I need to load and persist some fixtures first (so their id get populated) and then reference those entities ids from another bunch of fixture…

Stphane
- 3,368
- 5
- 32
- 47
2
votes
0 answers
Application parameter not found in test env
I'm using LiipFunctionalTestBundle with AliceBundle to test my Symfony 3.4 application with fixtures.
Everything is working fine but this specific case: Accessing application parameters from within a fixture loaded from a test in a Liip WebTestCase…

Pierre de LESPINAY
- 44,700
- 57
- 210
- 307
2
votes
1 answer
Reading OneToMany loaded recursive tree
I'm trying to do integration tests with Alice and some fixtures involving a recursive bi-directionnal relation.
class Node
{
/** [...]
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
*…

Pierre de LESPINAY
- 44,700
- 57
- 210
- 307