Skip to content

Revamped the data fixtures #727

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

Closed
wants to merge 4 commits into from
Closed

Revamped the data fixtures #727

wants to merge 4 commits into from

Conversation

javiereguiluz
Copy link
Member

After #724 and #725 I realized that our fixtures are not following the modern best practices recommended by DoctrineFixturesBundle (explained here):

  • Use 1 class to load all fixtures unless you have lots of fixtures.
  • Make the fixture class extend from Symfony's Fixture class instead of the complicated Doctrine's classes.
  • Inject services in the constructor and rely on autowiring.
  • etc.

@yceruto
Copy link
Member

yceruto commented Dec 5, 2017

I like this revamp, but we might need to keep the FixturesTrait into a separate file because it's used by tests/Controller/Admin/BlogControllerTest.php avoiding code duplication.

@javiereguiluz
Copy link
Member Author

@yceruto you are right. However, when I was going to do that change, I realized that we barely use the fixtures trait in tests. So, what do you think if we just replace the entire fixtures trait just by the the generateRandomString() method added in 7c3e865?

Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect to me!

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

Successfully merging this pull request may close these issues.

2 participants