Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Seeds #3948

Closed
DavertMik opened this issue Jan 24, 2017 · 3 comments
Closed

Laravel Seeds #3948

DavertMik opened this issue Jan 24, 2017 · 3 comments
Assignees
Labels

Comments

@DavertMik
Copy link
Member

@DavertMik DavertMik commented Jan 24, 2017

I received a report that seeds in Laravel5 module behave in a strange way. They are always created before each test but never reverted. And yes:

https://github.com/codeception/codeception/blob/2.2/src/Codeception/Module/Laravel5.php#L173

Here the options I see:

  • run seeds at the beginning of a test, reset them in the end of a test
  • run seeds inside a transaction at the beginning of a test, transaction will revert them
  • run seeds before suite and reuse them across tests...

Or maybe I don't understand something about Laravel seeders...

@janhenkgerritsen
Copy link
Contributor

@janhenkgerritsen janhenkgerritsen commented Jan 24, 2017

The default value for the config variable in the line you reference is false, so the database seed command will only run when the user explicitly sets this config variable to true.

I'll try to look at this issue this week, but it is highly likely that the report you received is wrong. From the top of my head I don't believe there is any other code related to the database seeds in the Laravel5 module than the line you referenced.

If the person that reported the issue to you is sure there is a problem with the Laravel5 module I'd like to have some more information.

@DavertMik
Copy link
Member Author

@DavertMik DavertMik commented Jan 24, 2017

Yes, it's about that seeder option in config only. It's not a critical bug but I don't understand how the seeds are expected to be used in this implementation. As I said, it has no meaning, running seeds before each test without reverting them

@janhenkgerritsen
Copy link
Contributor

@janhenkgerritsen janhenkgerritsen commented Jan 25, 2017

This issue should be fixed by the referenced commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.