Questions tagged [alice-fixtures]
35 questions
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
8
votes
1 answer
How to get doctrine fixture references by type of fixture in test in symfony WebTestCase?
I am using doctrine fixtures to load test data in my symfony application.
$this->fixtureLoader = $this->loadFixtures([
"My\DemonBundle\DataFixtures\ORM\LoadEntity1Data",
"My\DemonBundle\DataFixtures\ORM\LoadEntity2Data",
…

vishal
- 3,993
- 14
- 59
- 102
5
votes
3 answers
Alice bundle - how to use encoded password in yml fixture
I use hautelook/alice-bundle.
I can't use encoded bcrypt password in my fixture because of the following error ($ in interpreted as a reference to an object) :
In SimpleObjectGenerator.php line 114:
An error occurred while generating the fixture…

tux23
- 215
- 4
- 11
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
2 answers
Why does AliceBundle Fixture DateTime give me an unexpected value?
I'm currently working on a project in which I create fixtures with Alice-bundle to run tests to make sure my API-endpoints work properly. Everything works fine, except for the DateTime properties.
No matter what string I pass it, eg:…

Tienus McVinger
- 467
- 9
- 24
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
1 answer
Is there any way to convert a MySQL dump to YAML Alice Fixtures
I have a MySQL database dump with just the data I would like to use as Alice Fixtures. I would like to have versioned yaml files to commit onto my branch. Does someone know of a library or a bundle that parses SQL to generate YAML fixtures from them…

Mouradif
- 2,666
- 1
- 20
- 37
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
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
2 answers
Pass current variable into custom faker in Alice Nelmio Bundle Fixtures 2.x
I've created a fixtures loader class in Symfony with custom fakers.
One of this custom functions should return a name from an array of names depending on a non-random value. I'd like this value to be the $current variable when creating a collection…

Victor Salvans Montesó
- 390
- 3
- 15
2
votes
1 answer
Hautelook Alice: Custom Processor not loading
I am unable to load a custom processor while usinh hautelook/alice-bundle.
In my services.yml:
alice.processor.attendance:
class: MyVendor\MyBundle\DataFixtures\Processor\AttendanceProcessor
arguments: […

xfscrypt
- 16
- 5
- 28
- 59
1
vote
1 answer
Take fixture item by reference in nelmio-alice
I have a set of fixtures (here is a simplification):
My\Entity\User:
user_{1..10}:
name:
My\Entity\Item:
item_{1..10}:
user: '@user_$current'
data:
I want to fetch Item with ID 4…

Dmitry
- 7,457
- 12
- 57
- 83