yvoyer
yvoyer

Reputation: 7516

What is the loading order for fixtures files in Symfony 1.4

In my current project, I have multiple fixtures files. I would like to assign each files with data related to my tests.

ie:

Fixtures:

test/fixtures/commonAuthor.yml

    # Contains Common authors, with no particularities
    Author:
      Author1:
        name: Author1

test/fixtures/commonTag.yml

    # Contains Common tags, with no particularities
    Tag:
      Tag1:
        name: Tag1
      Tag2:
        name: Tag2

test/fixtures/test_Article.yml

    # Contains All the data that is used by my functionals and unit tests
    Tag:
      Tag_not_active:
        name: Tag not active
    Article:
      Article_1:
        title:  Article 1
        Tags:   [Tag1, Tag2]
        Author: Author1
      Article_with_tag_innactive:
        title:  Article 2
        Tags:   [Tag1, Tag2, Tag_not_active]
        Author: Author1

I wonder if the files are loaded alphabetically, or in any other order.

Thanks.

Upvotes: 1

Views: 777

Answers (1)

Maerlyn
Maerlyn

Reputation: 34107

If you're using doctrine, the dependencies between fixtures are detected automatically and they will be loaded in order to fulfill all of them.

If you're using propel, the files are loaded in alphabetical order.

Upvotes: 2

Related Questions