willdurand / BazingaFakerBundle

Put the awesome Faker library into the Symfony2 DIC and populate your database with fake data.
276 stars 35 forks source link

[InvalidArgumentException] text() can only generate text of at least 5 characters #8

Closed julienduthoit closed 12 years ago

julienduthoit commented 12 years ago

I'm using your bundle for a few time now. But today, when I wanted to use the command, I had this error :

[InvalidArgumentException]
text() can only generate text of at least 5 characters

Nothing has changed in the config.yml so I don't know from where it could have come from.

Thanks

willdurand commented 12 years ago

@fzaninotto, did you change something in Faker?

fzaninotto commented 12 years ago

yes! text(5) would always return an empty string. I fixed it, and now the behavior of text() is more normal, but it has a limit.

julienduthoit commented 12 years ago

Wow, fast answer! I may have spoke way too early, I didn't succeed to reproduce what it seems to be a bugfoot to me...

I didn't change the BazingaFakerBundle for a while but I think I've added a schema field without adding a proper option to the config_dev.yml ... I never had this problem before with every kind of field.

Sorry again for this quicky open issue.

julienduthoit commented 12 years ago

Didn't see your answer while posting but noticed the change in Lorem.php . Thanks

mamartins commented 11 years ago

I'm having the same error. I only put this on the yml: bazinga_faker: orm: doctrine entities: Scytale\UserBundle\Entity\User: number: 100

mamartins commented 11 years ago

after a few more tries to run the command with that it worked :p

sensi commented 11 years ago

Hi, I had that issue too. I've figured out that this issue special appears if you try to fill in a text into a doctrine property which only has a length of 1 char. In my case it appears also in the UserBundle\Entity\SystemUser with the gender field which has a length of 1. So be sure to set this field manually! @0biwan: It seems you have fix it by setting the value manually and not by calling multiple times the command :)